public writeBrokenCodeBlock ( string $message, integer $indent ) | ||
$message | string | |
$indent | integer |
private function writeErrorMessage() { foreach ($this->wrongMethodNames as $methodName) { $message = sprintf("I cannot generate the method '%s' for you because it is a reserved keyword", $methodName); $this->io->writeBrokenCodeBlock($message, 2); } }
function it_prompts_and_warns_when_one_method_name_is_correct_but_other_reserved($exampleEvent, SuiteEvent $suiteEvent, ConsoleIO $io, NameChecker $nameChecker) { $this->callAfterExample($exampleEvent, $nameChecker, 'throw', false); $this->callAfterExample($exampleEvent, $nameChecker, 'foo'); $io->writeBrokenCodeBlock("I cannot generate the method 'throw' for you because it is a reserved keyword", 2)->shouldBeCalled(); $io->askConfirmation('Do you want me to create `stdClass::foo()` for you?')->shouldBeCalled(); $suiteEvent->markAsNotWorthRerunning()->shouldBeCalled(); $this->afterSuite($suiteEvent); }