Exemple #1
0
 public function testWithAnyArguments()
 {
     $this->if($asserter = new \mock\mageekguy\atoum\asserters\mock(new asserter\generator()))->then->exception(function () use($asserter) {
         $asserter->withArguments(uniqid());
     })->isInstanceOf('mageekguy\\atoum\\exceptions\\logic')->hasMessage('Mock is undefined')->if($asserter->setWith($mock = new \mock\mageekguy\atoum\tests\units\asserters\dummy()))->then->exception(function () use($asserter) {
         $asserter->withArguments(uniqid());
     })->isInstanceOf('mageekguy\\atoum\\exceptions\\logic')->hasMessage('Called method is undefined')->if($asserter->call($function = uniqid()))->then->object($asserter->getCall())->isEqualTo(new php\call($function, null, $mock))->object($asserter->withAnyArguments())->isIdenticalTo($asserter)->object($asserter->getCall())->isEqualTo(new php\call($function, null, $mock))->if($asserter->withArguments($arg = uniqid()))->then->object($asserter->getCall())->isEqualTo(new php\call($function, array($arg), $mock))->object($asserter->withAnyArguments())->isIdenticalTo($asserter)->object($asserter->getCall())->isEqualTo(new php\call($function, null, $mock));
 }