Пример #1
0
 public function testWriteMessage()
 {
     $this->if($outputWriter = new mock\writers\std\out())->and($this->calling($outputWriter)->write->doesNothing())->and($script = new mock\script(uniqid()))->and($script->setOutputWriter($outputWriter))->then->object($script->writeMessage($message = uniqid()))->isIdenticalTo($script)->mock($outputWriter)->call('write')->withArguments($message)->after($this->mock($outputWriter)->call('removeDecorators')->once())->once();
 }
Пример #2
0
 public function testWriteMessage()
 {
     $this->if($stdOut = new mock\writers\std\out())->and($stdOut->getMockCOntroller()->write = function () {
     })->and($script = new mock\script(uniqid()))->and($script->setOutputWriter($stdOut))->then->object($script->writeMessage($message = uniqid()))->isIdenticalTo($script)->mock($stdOut)->call('write')->withIdenticalArguments($message . PHP_EOL)->once()->object($script->writeMessage(($message = uniqid()) . PHP_EOL))->isIdenticalTo($script)->mock($stdOut)->call('write')->withIdenticalArguments($message . PHP_EOL)->once()->object($script->writeMessage(($message = uniqid()) . ' ' . PHP_EOL))->isIdenticalTo($script)->mock($stdOut)->call('write')->withIdenticalArguments($message . PHP_EOL)->once()->object($script->writeMessage(($message = PHP_EOL . $message) . ' ' . PHP_EOL))->isIdenticalTo($script)->mock($stdOut)->call('write')->withIdenticalArguments($message . PHP_EOL)->once()->object($script->writeMessage($message = uniqid(), false))->isIdenticalTo($script)->mock($stdOut)->call('write')->withIdenticalArguments($message)->once()->object($script->writeMessage(($message = uniqid()) . PHP_EOL, false))->isIdenticalTo($script)->mock($stdOut)->call('write')->withIdenticalArguments($message)->once()->object($script->writeMessage(($message = uniqid()) . ' ' . PHP_EOL, false))->isIdenticalTo($script)->mock($stdOut)->call('write')->withIdenticalArguments($message)->once()->object($script->writeMessage(($message = PHP_EOL . $message) . ' ' . PHP_EOL, false))->isIdenticalTo($script)->mock($stdOut)->call('write')->withIdenticalArguments($message)->once();
 }