Changeset 1394
- Timestamp:
- 03/03/08 14:25:14 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/ioc/stubClassBinding.php
r1371 r1394 8 8 */ 9 9 stubClassLoader::load('net::stubbles::ioc::exceptions::stubBindingException', 10 'net::stubbles::ioc::stubBinding', 11 'net::stubbles::ioc::stubBindingScope', 10 12 'net::stubbles::ioc::stubDefaultInjectionProvider', 13 'net::stubbles::ioc::stubInjectionProvider', 14 'net::stubbles::ioc::stubValueInjectionProvider', 15 'net::stubbles::lang::exceptions::stubIllegalArgumentException', 16 'net::stubbles::reflection::stubBaseReflectionClass', 11 17 'net::stubbles::reflection::stubReflectionClass' 12 18 ); … … 80 86 * @param stubBaseReflectionClass|string $impl 81 87 * @return stubBinding 88 * @throws stubIllegalArgumentException 82 89 */ 83 90 public function to($impl) 84 91 { 92 if (is_string($impl) === false && ($impl instanceof stubBaseReflectionClass) === false) { 93 throw new stubIllegalArgumentException('$impl must be a string or an instance of net::stubbles::reflection::stubBaseReflectionClass'); 94 } 95 85 96 $this->impl = $impl; 86 97 return $this; trunk/src/test/php/net/stubbles/ioc/stubInjectorBasicTestCase.php
r1371 r1394 379 379 $this->assertType('stubInjectorTestCase_Tire', $vehicle->tire); 380 380 $this->assertType('stubInjectorTestCase_Goodyear', $vehicle->tire); 381 } 382 383 /** 384 * test bindings to an invalid type 385 * 386 * @test 387 * @expectedException stubIllegalArgumentException 388 */ 389 public function setterInjectionWithInvalidArgument() 390 { 391 $binder = new stubBinder(); 392 $binder->bind('stubInjectorTestCase_Vehicle')->to(313); 381 393 } 382 394 … … 422 434 } 423 435 424 425 436 /** 426 437 * test setter injections
