mageekguy\atoum\mock\generator::overload PHP Méthode

overload() public méthode

public overload ( method $method )
$method mageekguy\atoum\mock\php\method
    public function overload(php\method $method)
    {
        $this->overloadedMethods[strtolower($method->getName())] = $method;
        return $this;
    }

Usage Example

Exemple #1
0
 public function testMethodIsMockable()
 {
     $this->if($generator = new testedClass())->and($this->mockGenerator->orphanize('__construct'))->and($method = new \mock\reflectionMethod($this, $methodName = uniqid()))->and($this->calling($method)->getName = $methodName)->and($this->calling($method)->isFinal = false)->and($this->calling($method)->isStatic = false)->and($this->calling($method)->isAbstract = false)->and($this->calling($method)->isPrivate = false)->and($this->calling($method)->isProtected = false)->then->boolean($generator->methodIsMockable($method))->isTrue()->if($this->calling($method)->isFinal = true)->then->boolean($generator->methodIsMockable($method))->isFalse()->if($this->calling($method)->isFinal = false)->and($this->calling($method)->isStatic = true)->then->boolean($generator->methodIsMockable($method))->isFalse()->if($this->calling($method)->isStatic = false)->and($this->calling($method)->isPrivate = true)->then->boolean($generator->methodIsMockable($method))->isFalse()->if($this->calling($method)->isPrivate = false)->and($this->calling($method)->isProtected = true)->then->boolean($generator->methodIsMockable($method))->isFalse()->if($generator->overload(new mock\php\method($methodName)))->then->boolean($generator->methodIsMockable($method))->isTrue();
 }
All Usage Examples Of mageekguy\atoum\mock\generator::overload