Changeset 1388
- Timestamp:
- 02/28/08 00:37:38 (5 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/test/php/net/stubbles/reflection/stubReflectionFunctionTestCase.php
r1305 r1388 9 9 stubClassLoader::load('net::stubbles::reflection::stubReflectionFunction'); 10 10 /** 11 * Helper annotation for the test. 12 * 13 * @package stubbles 14 * @subpackage reflection_test 15 */ 16 class FunctionTest extends stubAbstractAnnotation implements stubAnnotation 17 { 18 /** 19 * Returns the target of the annotation as bitmap. 20 * 21 * @return int 22 */ 23 public function getAnnotationTarget() 24 { 25 return stubAnnotation::TARGET_FUNCTION; 26 } 27 } 28 /** 11 29 * does not return anything 30 * 31 * @FunctionTest() 12 32 */ 13 33 function stubTestWithOutParams() {} … … 87 107 88 108 /** 109 * only one of the functions has an annotation 110 * 111 * @test 112 */ 113 public function hasAnnotation() 114 { 115 $this->assertTrue($this->stubRefFunction2->hasAnnotation('FunctionTest')); 116 $this->assertFalse($this->stubRefFunction2->hasAnnotation('Other')); 117 } 118 119 /** 120 * only one of the functions has an annotation 121 * 122 * @test 123 */ 124 public function getAnnotation() 125 { 126 $this->assertType('FunctionTest', $this->stubRefFunction2->getAnnotation('FunctionTest')); 127 } 128 129 /** 89 130 * test that getting the parameters works correct 90 131 * trunk/src/test/php/net/stubbles/reflection/stubReflectionPackageTestCase.php
r1305 r1388 44 44 $this->assertFalse($this->stubRefPackage->equals($stubRefPackage2)); 45 45 $this->assertFalse($stubRefPackage2->equals($this->stubRefPackage)); 46 $this->assertFalse($stubRefPackage1->equals('not equal')); 47 $this->assertFalse($stubRefPackage2->equals('not equal')); 46 48 } 47 49 … … 106 108 107 109 /** 110 * assert that all classes are returned 111 * 112 * @test 113 */ 114 public function getClassNames() 115 { 116 $stubRefPackage = new stubReflectionPackage('org::stubbles::test::package1'); 117 $this->assertEquals(2, count($stubRefPackage->getClassNames(false))); 118 $this->assertEquals(3, count($stubRefPackage->getClassNames(true))); 119 120 $stubRefPackage = new stubReflectionPackage('org::stubbles::test::package2'); 121 $this->assertEquals(0, count($stubRefPackage->getClassNames(false))); 122 $this->assertEquals(0, count($stubRefPackage->getClassNames(true))); 123 } 124 125 /** 108 126 * test hasPackage() 109 127 *
