From 904b9f5f1cd66886e10a3477e78e1f6c9d393677 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Fri, 11 Dec 2009 00:46:13 -0500 Subject: [PATCH] Adding test and fix to ensure the debug = 0, log = false leaves error_reporting set to 0. Fixes #89 --- cake/libs/configure.php | 2 +- cake/tests/cases/libs/configure.test.php | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cake/libs/configure.php b/cake/libs/configure.php index 450d0a8e0..4c9d2526c 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -109,7 +109,7 @@ class Configure extends Object { } } - if (isset($config['debug'])) { + if (isset($config['debug']) || isset($config['log'])) { $reporting = 0; if ($_this->debug) { if (!class_exists('Debugger')) { diff --git a/cake/tests/cases/libs/configure.test.php b/cake/tests/cases/libs/configure.test.php index 40a761932..27eb6d27a 100644 --- a/cake/tests/cases/libs/configure.test.php +++ b/cake/tests/cases/libs/configure.test.php @@ -176,6 +176,11 @@ class ConfigureTest extends CakeTestCase { Configure::write('debug', 2); $this->assertEqual(ini_get('error_reporting'), E_ALL & ~E_DEPRECATED); $this->assertEqual(ini_get('display_errors'), 1); + + Configure::write('debug', 0); + Configure::write('log', false); + $this->assertEqual(ini_get('error_reporting'), 0); + $this->assertEqual(ini_get('display_errors'), 0); } /**