Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Tests;
  4.  
  5. use Symfony\Bundle\FrameworkBundle\Console\Application;
  6. use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
  7. use Symfony\Component\Console\Tester\CommandTester;
  8.  
  9. class TestGetExchangeRatesCommandTest extends KernelTestCase
  10. {
  11. public function testExecute(){
  12. $kernel = static::createKernel();
  13. $application = new Application($kernel);
  14.  
  15. $command = $application->find('getExchangeRates');
  16. $commandTester = new CommandTester($command);
  17. $commandTester->execute([
  18. 'command' => $command->getName()
  19. ]);
  20.  
  21. $output = $commandTester->getDisplay();
  22. $this->assertContains('Exchange Rates Command Executed Successfully', $output);
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement