Changeset 254
- Timestamp:
- 02/10/07 17:29:40 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/reflection/stubReflectionObject.php
r253 r254 32 32 * instance of the reflected class 33 33 * 34 * @var object 35 */ 36 protected $classObject; 37 /** 38 * docblock comment for this class 39 * 34 40 * @var string 35 41 */ 36 protected $classObject;37 /**38 * docblock comment for this class39 *40 * @var string41 */42 42 protected $docComment; 43 43 … … 45 45 * constructor 46 46 * 47 * @param string$classObject instance of class to reflect47 * @param object $classObject instance of class to reflect 48 48 */ 49 49 public function __construct($classObject) … … 136 136 137 137 /** 138 * returns the instance of the class with with this reflection instance was created 139 * 140 * @return object 141 */ 142 public function getObjectInstance() 143 { 144 return $this->classObject; 145 } 146 147 /** 138 148 * returns the constructor or null if none exists 139 149 * trunk/src/test/php/net/stubbles/reflection/stubReflectionObjectTestCase.php
r98 r254 29 29 */ 30 30 protected $stubRefClass2; 31 /** 32 * the first reflected object 33 * 34 * @var stubTestWithMethodsAndProperties 35 */ 36 protected $reflectedObject1; 37 /** 38 * the second reflected object 39 * 40 * @var stubTestWithOutMethodsAndProperties 41 */ 42 protected $reflectedObject2; 31 43 32 44 /** … … 35 47 public function setUp() 36 48 { 37 $this->stubRefClass1 = new stubReflectionObject(new stubTestWithMethodsAndProperties()); 38 $this->stubRefClass2 = new stubReflectionObject(new stubTestWithOutMethodsAndProperties()); 49 $this->reflectedObject1 = new stubTestWithMethodsAndProperties(); 50 $this->stubRefClass1 = new stubReflectionObject($this->reflectedObject1); 51 $this->reflectedObject2 = new stubTestWithOutMethodsAndProperties(); 52 $this->stubRefClass2 = new stubReflectionObject($this->reflectedObject2); 39 53 } 40 54 … … 62 76 $this->assertTrue((string) $this->stubRefClass1, "reflection.stubReflectionObject[stubTestWithMethodsAndProperties] {\n}\n"); 63 77 $this->assertTrue((string) $this->stubRefClass2, "reflection.stubReflectionObject[stubTestWithOutMethodsAndProperties] {\n}\n"); 78 } 79 80 /** 81 * test that the original object instance is returned 82 */ 83 public function testGetObjectInstance() 84 { 85 $reflectedObject1 = $this->stubRefClass1->getObjectInstance(); 86 $this->assertReference($reflectedObject1, $this->reflectedObject1); 87 $reflectedObject2 = $this->stubRefClass2->getObjectInstance(); 88 $this->assertReference($reflectedObject2, $this->reflectedObject2); 64 89 } 65 90
