Changeset 556

Show
Ignore:
Timestamp:
04/18/07 18:06:48 (2 years ago)
Author:
mikey
Message:

patch SimpleTest?: partial mock did not correctly implement an abstract method
(needs review against SimpleTest? HEAD, probably create a bug report and patch with test case for the SimpleTest? devs)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/org/simpletest/reflection_php5.php

    r172 r556  
    185185        } 
    186186 
     187        function _isAbstractMethod($name) 
     188        { 
     189            $interface = new ReflectionClass($this->_interface); 
     190            $method = $interface->getMethod($name); 
     191            return $method->isAbstract(); 
     192        } 
     193         
    187194        /** 
    188195         *    Gets the source code matching the declaration 
     
    205212                } 
    206213            } 
    207             if (! is_callable(array($this->_interface, $name))) { 
     214            if (! is_callable(array($this->_interface, $name)) && $this->_isAbstractMethod($name) == false) { 
    208215                return "function $name()"; 
    209216            } 
    210             if ($this->_isInterfaceMethod($name)) { 
     217            if ($this->_isInterfaceMethod($name) || $this->_isAbstractMethod($name)) { 
    211218                return $this->_getFullSignature($name); 
    212219            }