diff --git a/cake/libs/configure.php b/cake/libs/configure.php index 7fde78601..433231742 100644 --- a/cake/libs/configure.php +++ b/cake/libs/configure.php @@ -284,7 +284,10 @@ class Configure { * * @return array Array of the configured reader objects. */ - public static function configured() { + public static function configured($name = null) { + if ($name) { + return isset(self::$_readers[$name]); + } return array_keys(self::$_readers); } diff --git a/cake/tests/cases/libs/configure.test.php b/cake/tests/cases/libs/configure.test.php index 0e3a3b52c..eb9cb63b5 100644 --- a/cake/tests/cases/libs/configure.test.php +++ b/cake/tests/cases/libs/configure.test.php @@ -294,6 +294,10 @@ class ConfigureTest extends CakeTestCase { $configured = Configure::configured(); $this->assertTrue(in_array('test', $configured)); + + $this->assertTrue(Configure::configured('test')); + $this->assertFalse(Configure::configured('fake_garbage')); + $this->assertTrue(Configure::drop('test')); $this->assertFalse(Configure::drop('test'), 'dropping things that do not exist should return false.'); }