wasCalled() public method

public wasCalled ( $failMessage = null )
Example #1
0
 public function testWasCalled()
 {
     $this->if($asserter = new sut($generator = new asserter\generator()))->then->exception(function () use($asserter) {
         $asserter->wasCalled();
     })->isInstanceOf('mageekguy\\atoum\\exceptions\\logic')->hasMessage('Mock is undefined')->if($adapter = new atoum\test\adapter())->and($adapter->class_exists = true)->and($asserter->setWith($mock = new \mock\mageekguy\atoum\tests\units\asserters\mock($adapter)))->and($mock->getMockController()->resetCalls())->then->exception(function () use($asserter) {
         $asserter->wasCalled();
     })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage(sprintf($generator->getLocale()->_('%s is not called'), get_class($mock)))->exception(function () use($asserter, &$failMessage) {
         $asserter->wasCalled($failMessage = uniqid());
     })->isInstanceOf('mageekguy\\atoum\\asserter\\exception')->hasMessage($failMessage)->if($mock->getMockController()->{$method = __FUNCTION__} = function () {
     })->and($mock->{$method}())->then->object($asserter->wasCalled())->isIdenticalTo($asserter);
 }