mageekguy\atoum\runner::disallowUsageOfUndefinedMethodInMock PHP Method

disallowUsageOfUndefinedMethodInMock() public method

    public function disallowUsageOfUndefinedMethodInMock()
    {
        $this->disallowUsageOfUndefinedMethodInMock = true;
        return $this;
    }

Usage Example

Beispiel #1
0
 public function testSetTestFactory()
 {
     $this->if($runner = new testedClass())->then->variable($runner->getTestFactory())->isCallable->object($runner->setTestFactory())->isIdenticalTo($runner)->object($runner->getTestFactory())->isCallable->if($factory = function () {
     })->then->object($runner->setTestFactory($factory))->isIdenticalTo($runner)->object($runner->getTestFactory())->isCallable->given($test = new \mock\mageekguy\atoum\test())->and($generator = new \mock\mageekguy\atoum\test\mock\generator($test))->and($test->setMockGenerator($generator))->if($runner->disallowUsageOfUndefinedMethodInMock())->and($runner->setTestFactory(function () use($test) {
         return $test;
     }))->and($factory = $runner->getTestFactory())->then->object($factory('mock\\mageekguy\\atoum\\test'))->isIdenticalTo($test)->mock($generator)->call('disallowUndefinedMethodUsage')->once->if($this->resetMock($generator))->if($runner->allowUsageOfUndefinedMethodInMock())->then->object($factory('mock\\mageekguy\\atoum\\test'))->isIdenticalTo($test)->mock($generator)->call('disallowUndefinedMethodUsage')->never;
 }
runner