Changeset 255

Show
Ignore:
Timestamp:
02/10/07 17:37:15 (2 years ago)
Author:
mikey
Message:

added net.stubbles.reflection.stubBaseReflectionClass::getFullQualifiedClassName()
changed implementation so that it returns the non qualified classname in case the class has not been loaded with stubClassLoader::load()

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/reflection/stubBaseReflectionClass.php

    r252 r255  
    2020interface stubBaseReflectionClass 
    2121{ 
    22     // intentionally empty 
     22    /** 
     23     * returns the full qualified class name of the reflected class 
     24     *  
     25     * If the class has not been loaded with stubClassLoader the non qualified  
     26     * class name will be returned. 
     27     * 
     28     * @return  string 
     29     */ 
     30    public function getFullQualifiedClassName(); 
    2331} 
    2432?> 
  • trunk/src/main/php/net/stubbles/reflection/stubReflectionClass.php

    r253 r255  
    106106     * returns the full qualified class name of the reflected class 
    107107     *  
    108      * Only possible for classes loaded with stubClassLoader. 
     108     * If the class has not been loaded with stubClassLoader the non qualified  
     109     * class name will be returned. 
    109110     * 
    110111     * @return  string 
     
    112113    public function getFullQualifiedClassName() 
    113114    { 
    114         return stubClassLoader::getFullQualifiedClassName($this->className); 
     115        $fqClassName = stubClassLoader::getFullQualifiedClassName($this->className); 
     116        if (null == $fqClassName) { 
     117            return $this->className; 
     118        } 
     119         
     120        return $fqClassName; 
    115121    } 
    116122     
  • trunk/src/main/php/net/stubbles/reflection/stubReflectionObject.php

    r254 r255  
    126126     * returns the full qualified class name of the reflected class 
    127127     *  
    128      * Only possible for classes loaded with stubClassLoader. 
     128     * If the class has not been loaded with stubClassLoader the non qualified  
     129     * class name will be returned. 
    129130     * 
    130131     * @return  string 
     
    132133    public function getFullQualifiedClassName() 
    133134    { 
    134         return stubClassLoader::getFullQualifiedClassName($this->className); 
     135        $fqClassName = stubClassLoader::getFullQualifiedClassName($this->className); 
     136        if (null == $fqClassName) { 
     137            return $this->className; 
     138        } 
     139         
     140        return $fqClassName; 
    135141    } 
    136142     
  • trunk/src/test/php/net/stubbles/reflection/stubReflectionClassTestCase.php

    r98 r255  
    6262        $this->assertTrue((string) $this->stubRefClass1, "reflection.stubReflectionClass[stubTestWithMethodsAndProperties] {\n}\n"); 
    6363        $this->assertTrue((string) $this->stubRefClass2, "reflection.stubReflectionClass[stubTestWithOutMethodsAndProperties] {\n}\n"); 
     64    } 
     65     
     66    /** 
     67     * test the full qualified class name 
     68     */ 
     69    public function testGetFullQualifiedClassName() 
     70    { 
     71        $this->assertEqual($this->stubRefClass1->getFullQualifiedClassName(), 'stubTestWithMethodsAndProperties'); 
     72        $this->assertEqual($this->stubRefClass2->getFullQualifiedClassName(), 'stubTestWithOutMethodsAndProperties'); 
    6473    } 
    6574     
  • trunk/src/test/php/net/stubbles/reflection/stubReflectionObjectTestCase.php

    r254 r255  
    7979     
    8080    /** 
     81     * test the full qualified class name 
     82     */ 
     83    public function testGetFullQualifiedClassName() 
     84    { 
     85        $this->assertEqual($this->stubRefClass1->getFullQualifiedClassName(), 'stubTestWithMethodsAndProperties'); 
     86        $this->assertEqual($this->stubRefClass2->getFullQualifiedClassName(), 'stubTestWithOutMethodsAndProperties'); 
     87    } 
     88     
     89    /** 
    8190     * test that the original object instance is returned 
    8291     */