TestCommandTest.php 769 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace Facade\Ignition\Tests\Commands;
  3. use Facade\Ignition\Tests\TestCase;
  4. class TestCommandTest extends TestCase
  5. {
  6. protected $withFlareKey = false;
  7. protected function getEnvironmentSetUp($app)
  8. {
  9. if ($this->withFlareKey) {
  10. $app['config']['flare.key'] = 'some-key';
  11. }
  12. }
  13. public function withFlareKey()
  14. {
  15. $this->withFlareKey = true;
  16. $this->refreshApplication();
  17. }
  18. /** @test */
  19. public function it_can_execute_the_test_command_when_a_flare_key_is_present()
  20. {
  21. $this->withFlareKey();
  22. $testResult = $this->artisan('flare:test');
  23. is_int($testResult)
  24. ? $this->assertSame(0, $testResult)
  25. : $testResult->assertExitCode(0);
  26. }
  27. }