| Conditions | 1 |
| Paths | 1 |
| Total Lines | 26 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace Phprest\Command\Route; |
||
| 12 | public function testDisplayedData(): void |
||
| 13 | { |
||
| 14 | $phprestApp = new PhprestApp(new Config('phprest-test', '2.3', true)); |
||
| 15 | $phprestApp->get('/2.3/get-the-answer-of-everything', 'Phprest\Stub\Controller::getTheAnswerOfEverything'); |
||
| 16 | $phprestApp->get('/2.3/get-welcome-message', static function () { |
||
| 17 | return new Response('Welcome!'); |
||
| 18 | }); |
||
| 19 | |||
| 20 | $cliApp = new ConsoleApp(); |
||
| 21 | $cliApp->add(new Get($phprestApp)); |
||
| 22 | |||
| 23 | $command = $cliApp->find('routes:get'); |
||
| 24 | $commandTester = new CommandTester($command); |
||
| 25 | $commandTester->execute(['command' => $command->getName()]); |
||
| 26 | |||
| 27 | $displayedData = $commandTester->getDisplay(); |
||
| 28 | |||
| 29 | $this->assertContains( |
||
| 30 | '| GET | /2.3/get-the-answer-of-everything | Phprest\Stub\Controller::getTheAnswerOfEverything |', |
||
| 31 | $displayedData |
||
| 32 | ); |
||
| 33 | $this->assertContains( |
||
| 34 | '| GET | /2.3/get-welcome-message | Closure |', |
||
| 35 | $displayedData |
||
| 36 | ); |
||
| 37 | } |
||
| 38 | } |
||
| 39 |