Changeset 1930
- Timestamp:
- 11/13/08 23:14:41 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
framework/trunk/src/main/php/net/stubbles/ioc/stubBinderRegistry.php
r1752 r1930 6 6 * @package stubbles 7 7 * @subpackage ioc 8 * @version $Id$ 8 9 */ 9 10 stubClassLoader::load('net::stubbles::ioc::stubBinder', … … 19 20 class stubBinderRegistry extends stubBaseObject 20 21 { 22 /** 23 * checks if a binder is available 24 * 25 * @return bool 26 */ 27 public static function hasInstance() 28 { 29 return (null !== stubRegistry::get(stubBinder::REGISTRY_KEY)); 30 } 31 21 32 /** 22 33 * retrieves binder instance from registry framework/trunk/src/test/php/net/stubbles/ioc/stubBinderRegistryTestCase.php
r1752 r1930 6 6 * @package stubbles 7 7 * @subpackage ioc_test 8 * @version $Id$ 8 9 */ 9 10 stubClassLoader::load('net::stubbles::ioc::stubBinderRegistry'); 10 11 11 /** 12 12 * Test for net::stubbles::ioc::stubBinderRegistry … … 32 32 { 33 33 stubRegistry::set(stubBinder::REGISTRY_KEY, null); 34 } 35 36 /** 37 * hasInstance() returns false if registry does not contain a binder 38 * 39 * @test 40 */ 41 public function hasInstanceWithoutInstanceInRegistryReturnsFalse() 42 { 43 $this->assertFalse(stubBinderRegistry::hasInstance()); 44 } 45 46 /** 47 * hasInstance() returns true if registry contains a binder 48 * 49 * @test 50 */ 51 public function hasInstanceWithInstanceInRegistryReturnsTrue() 52 { 53 stubRegistry::set(stubBinder::REGISTRY_KEY, new stubBinder()); 54 $this->assertTrue(stubBinderRegistry::hasInstance()); 34 55 } 35 56
