Changeset 1388

Show
Ignore:
Timestamp:
02/28/08 00:37:38 (5 months ago)
Author:
mikey
Message:

added some more tests

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/test/php/net/stubbles/reflection/stubReflectionFunctionTestCase.php

    r1305 r1388  
    99stubClassLoader::load('net::stubbles::reflection::stubReflectionFunction'); 
    1010/** 
     11 * Helper annotation for the test. 
     12 * 
     13 * @package     stubbles 
     14 * @subpackage  reflection_test 
     15 */ 
     16class 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/** 
    1129 * does not return anything 
     30 * 
     31 * @FunctionTest() 
    1232 */ 
    1333function stubTestWithOutParams() {} 
     
    87107 
    88108    /** 
     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    /** 
    89130     * test that getting the parameters works correct 
    90131     * 
  • trunk/src/test/php/net/stubbles/reflection/stubReflectionPackageTestCase.php

    r1305 r1388  
    4444        $this->assertFalse($this->stubRefPackage->equals($stubRefPackage2)); 
    4545        $this->assertFalse($stubRefPackage2->equals($this->stubRefPackage)); 
     46        $this->assertFalse($stubRefPackage1->equals('not equal')); 
     47        $this->assertFalse($stubRefPackage2->equals('not equal')); 
    4648    } 
    4749     
     
    106108 
    107109    /** 
     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    /** 
    108126     * test hasPackage() 
    109127     *