/** * @covers module_console_aboutAuthors::execute */ public function testExecute() { $application = new CLI('test', null, 'test'); $application->command(new module_console_aboutAuthors('about:authors')); $command = $application['console']->find('about:authors'); $commandTester = new CommandTester($command); $commandTester->execute(['command' => $command->getName()]); $this->assertEquals(trim(file_get_contents(__DIR__ . '/../../../../AUTHORS')), trim($commandTester->getDisplay())); }
public function testExecute() { $application = new CLI('test', null, 'test'); $application->command(new module_console_systemTemplateGenerator('system:templateGenerator')); $command = $application['console']->find('system:templateGenerator'); $commandTester = new CommandTester($command); $commandTester->execute(['command' => $command->getName()]); $data = explode("\n", trim($commandTester->getDisplay())); $last_line = array_pop($data); $this->assertTrue(strpos($last_line, 'templates failed') === false, 'Some templates failed'); $this->assertTrue(strpos($last_line, 'templates generated') !== true, 'Some templates have been generated'); }