diff --git a/README.md b/README.md index 4a8f3e5..4202e62 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # Laravel Testing Tools -[Become a Patron](https://patreon.com/dmitryivanov) +[Buy me a coffee](https://buymeacoffee.com/dmitry.ivanov) [![StyleCI](https://github.styleci.io/repos/75414626/shield?branch=9.x&style=flat)](https://github.styleci.io/repos/75414626?branch=9.x) [![Build Status](https://img.shields.io/github/workflow/status/dmitry-ivanov/laravel-testing-tools/tests/9.x)](https://github.com/dmitry-ivanov/laravel-testing-tools/actions?query=workflow%3Atests+branch%3A9.x) @@ -38,7 +38,7 @@ Laravel-specific Testing Helpers and Assertions. composer require --dev "illuminated/testing-tools:^9.0" ``` -2. Use `Illuminated\Testing\TestingTools` and disable `$mockConsoleOutput`: +2. Use `Illuminated\Testing\TestingTools` trait: ```php use Illuminated\Testing\TestingTools; @@ -47,8 +47,6 @@ Laravel-specific Testing Helpers and Assertions. { use TestingTools; - public $mockConsoleOutput = false; - // ... } ``` @@ -56,14 +54,14 @@ Laravel-specific Testing Helpers and Assertions. 3. Use any of the provided helpers and assertions in your tests: ```php - class HelloCommandTest extends TestCase + class ExampleCommandTest extends TestCase { /** @test */ - public function it_outputs_hello_world() + public function it_logs_hello_world() { - $this->artisan('hello'); + $this->artisan('example'); - $this->seeArtisanOutput('Hello, World!'); + $this->seeInLogFile('example.log', 'Hello World!'); } } ``` @@ -77,26 +75,11 @@ Laravel-specific Testing Helpers and Assertions. - [emulateProduction](#emulateproduction) - [emulateEnvironment](#emulateenvironment) - [isTravis](#istravis) -- [ArtisanHelpers](#artisanhelpers) - - [runArtisan](#runartisan) ## Available assertions > Feel free to contribute. -- [ArtisanAsserts](#artisanasserts) - - [willSeeConfirmation](#willseeconfirmation) - - [willNotSeeConfirmation](#willnotseeconfirmation) - - [willGiveConfirmation](#willgiveconfirmation) - - [willNotGiveConfirmation](#willnotgiveconfirmation) - - [seeArtisanOutput](#seeartisanoutput) - - [dontSeeArtisanOutput](#dontseeartisanoutput) - - [seeInArtisanOutput](#seeinartisanoutput) - - [dontSeeInArtisanOutput](#dontseeinartisanoutput) - - [seeArtisanTableOutput](#seeartisantableoutput) - - [dontSeeArtisanTableOutput](#dontseeartisantableoutput) - - [seeArtisanTableRowsCount](#seeartisantablerowscount) - - [dontSeeArtisanTableRowsCount](#dontseeartisantablerowscount) - [CollectionAsserts](#collectionasserts) - [assertCollectionsEqual](#assertcollectionsequal) - [assertCollectionsNotEqual](#assertcollectionsnotequal) @@ -188,162 +171,8 @@ $this->isTravis(); // true ``` -### ArtisanHelpers - -#### `runArtisan()` - -Run the given artisan console command: - -```php -$command = $this->runArtisan(MyCommand::class, ['--name' => 'John']); - -// \Illuminate\Console\Command -``` - -Also, you can pass the command instance as a first argument: - -```php -$command = $this->runArtisan(new MyCommand, ['--name' => 'Jane']); - -// \Illuminate\Console\Command -``` - ## Assertions -### ArtisanAsserts - -#### `willSeeConfirmation()` - -Add expectation that the given confirmation question would be shown: - -```php -$this->willSeeConfirmation('Are you sure?', MyCommand::class); -``` - -#### `willNotSeeConfirmation()` - -Add expectation that the given confirmation question would not be shown: - -```php -$this->willNotSeeConfirmation('Are you sure?', MyCommand::class); -``` - -#### `willGiveConfirmation()` - -Add expectation that the given confirmation question would be shown, and accept it: - -```php -$this->willGiveConfirmation('Are you sure?', MyCommand::class); - -$this->seeArtisanOutput('Done!'); -``` - -#### `willNotGiveConfirmation()` - -Add expectation that the given confirmation question would be shown, and do not accept it: - -```php -$this->willNotGiveConfirmation('Are you sure?', MyCommand::class); - -$this->dontSeeArtisanOutput('Done!'); -``` - -#### `seeArtisanOutput()` - -Assert that the given artisan output is seen: - -```php -$this->seeArtisanOutput('Hello, World!'); -``` - -Also, you can specify a path to the file containing output: - -```php -$this->seeArtisanOutput('correct.output.txt'); -``` - -#### `dontSeeArtisanOutput()` - -Assert that the given artisan output is not seen: - -```php -$this->dontSeeArtisanOutput('Hello, Universe!'); -``` - -Also, you can specify a path to the file containing output: - -```php -$this->dontSeeArtisanOutput('incorrect.output.txt'); -``` - -#### `seeInArtisanOutput()` - -Assert that the given string is seen in the artisan output: - -```php -$this->seeInArtisanOutput('Hello'); -``` - -Also, you can specify a path to the file containing the string: - -```php -$this->seeInArtisanOutput('needle.txt'); -``` - -#### `dontSeeInArtisanOutput()` - -Assert that the given string is not seen in the artisan output: - -```php -$this->dontSeeInArtisanOutput('FooBar'); -``` - -Also, you can specify a path to the file containing the string: - -```php -$this->dontSeeInArtisanOutput('wrong-needle.txt'); -``` - -#### `seeArtisanTableOutput()` - -Assert that the given data is seen in the artisan table output: - -```php -$this->seeArtisanTableOutput([ - ['System' => 'Node-1', 'Status' => 'Enabled'], - ['System' => 'Node-2', 'Status' => 'Enabled'], - ['System' => 'Node-3', 'Status' => 'Enabled'], -]); -``` - -#### `dontSeeArtisanTableOutput()` - -Assert that the given data is not seen in the artisan table output: - -```php -$this->dontSeeArtisanTableOutput([ - ['System' => 'Node-1', 'Status' => 'Disabled'], - ['System' => 'Node-2', 'Status' => 'Disabled'], - ['System' => 'Node-3', 'Status' => 'Disabled'], -]); -``` - -#### `seeArtisanTableRowsCount()` - -Assert that the artisan table output has the given number of data rows: - -```php -$this->seeArtisanTableRowsCount(3); -``` - -#### `dontSeeArtisanTableRowsCount()` - -Assert that the artisan table output doesn't have the given number of data rows: - -```php -$this->dontSeeArtisanTableRowsCount(5); -``` - ### CollectionAsserts #### `assertCollectionsEqual()` diff --git a/src/Asserts/ArtisanAsserts.php b/src/Asserts/ArtisanAsserts.php deleted file mode 100644 index 1ff7e75..0000000 --- a/src/Asserts/ArtisanAsserts.php +++ /dev/null @@ -1,175 +0,0 @@ -shouldReceive('confirm')->once()->with($question); - - $this->runArtisan($mock, $parameters); - } - - /** - * Add expectation that the given confirmation question would not be shown. - */ - protected function willNotSeeConfirmation(string $question, string $command, array $parameters = []): void - { - $mock = Mockery::mock("{$command}[confirm]"); - $mock->shouldNotReceive('confirm')->with($question); - - $this->runArtisan($mock, $parameters); - } - - /** - * Add expectation that the given confirmation question would be shown, and accept it. - */ - protected function willGiveConfirmation(string $question, string $command, array $parameters = []): void - { - $mock = Mockery::mock("{$command}[confirm]"); - $mock->shouldReceive('confirm')->once()->with($question)->andReturn(true); - - $this->runArtisan($mock, $parameters); - } - - /** - * Add expectation that the given confirmation question would be shown, and do not accept it. - */ - protected function willNotGiveConfirmation(string $question, string $command, array $parameters = []): void - { - $mock = Mockery::mock("{$command}[confirm]"); - $mock->shouldReceive('confirm')->once()->with($question)->andReturn(false); - - $this->runArtisan($mock, $parameters); - } - - /** - * Assert that the given artisan output is seen. - */ - protected function seeArtisanOutput(string $output): void - { - if (File::exists($output)) { - $output = File::get($output); - } - - $expected = trim($output); - $actual = trim($this->getArtisanOutput()); - $this->assertEquals($expected, $actual, "Failed asserting that artisan output is `{$expected}`."); - } - - /** - * Assert that the given artisan output is not seen. - */ - protected function dontSeeArtisanOutput(string $output): void - { - if (File::exists($output)) { - $output = File::get($output); - } - - $expected = trim($output); - $actual = trim($this->getArtisanOutput()); - $this->assertNotEquals($expected, $actual, "Failed asserting that artisan output is not `{$expected}`."); - } - - /** - * Assert that the given string is seen in the artisan output. - */ - protected function seeInArtisanOutput(string $needle): void - { - if (File::exists($needle)) { - $needle = File::get($needle); - } - - $output = $this->getArtisanOutput(); - $message = "Failed asserting that artisan output contains `{$needle}`."; - $this->assertStringContainsString($needle, $output, $message); - } - - /** - * Assert that the given string is not seen in the artisan output. - */ - protected function dontSeeInArtisanOutput(string $needle): void - { - if (File::exists($needle)) { - $needle = File::get($needle); - } - - $output = $this->getArtisanOutput(); - $message = "Failed asserting that artisan output not contains `{$needle}`."; - $this->assertStringNotContainsString($needle, $output, $message); - } - - /** - * Assert that the given data is seen in the artisan table output. - */ - protected function seeArtisanTableOutput(array $data): void - { - $message = 'Failed asserting that artisan table output consists of expected data.'; - $this->assertEquals($data, $this->parseArtisanTableOutput($this->getArtisanOutput()), $message); - } - - /** - * Assert that the given data is not seen in the artisan table output. - */ - protected function dontSeeArtisanTableOutput(array $data): void - { - $message = 'Failed asserting that artisan table output not consists of expected data.'; - $this->assertNotEquals($data, $this->parseArtisanTableOutput($this->getArtisanOutput()), $message); - } - - /** - * Assert that the artisan table output has the given number of data rows. - */ - protected function seeArtisanTableRowsCount(int $count): void - { - $message = "Failed asserting that artisan table rows count equals to `{$count}`."; - $this->assertCount($count, $this->parseArtisanTableOutput($this->getArtisanOutput()), $message); - } - - /** - * Assert that the artisan table output doesn't have the given number of data rows. - */ - protected function dontSeeArtisanTableRowsCount(int $count): void - { - $message = "Failed asserting that artisan table rows count not equals to `{$count}`."; - $this->assertNotCount($count, $this->parseArtisanTableOutput($this->getArtisanOutput()), $message); - } - - /** - * Parse the artisan table output. - * - * Return data rows with headers as keys. - */ - private function parseArtisanTableOutput(string $output): array - { - $output = explode("\n", trim($output)); - - // Filter and normalize the output - $output = collect($output) - ->reject(function (string $line) { - return !Str::contains($line, '|'); - }) - ->map(function (string $line) { - $line = explode('|', $line); - $line = array_filter($line); - return array_map('trim', $line); - }); - - // The first item is headers - $headers = $output->shift(); - - // Combine headers with the line values - return $output->map(function (array $values) use ($headers) { - return array_combine($headers, $values); - })->toArray(); - } -} diff --git a/src/Helpers/ArtisanHelpers.php b/src/Helpers/ArtisanHelpers.php deleted file mode 100644 index c5027bc..0000000 --- a/src/Helpers/ArtisanHelpers.php +++ /dev/null @@ -1,48 +0,0 @@ -setLaravel($this->app); - - self::$artisanOutput = new BufferedOutput; - $command->run(new ArrayInput($parameters), self::$artisanOutput); - - return $command; - } - - /** - * Get artisan output. - */ - protected function getArtisanOutput(): string - { - $output = Artisan::output(); - if (!empty($output)) { - self::$artisanOutput = $output; - } - - if (self::$artisanOutput instanceof BufferedOutput) { - self::$artisanOutput = self::$artisanOutput->fetch(); - } - - return self::$artisanOutput; - } -} diff --git a/src/TestingTools.php b/src/TestingTools.php index 32212df..8c5ca10 100644 --- a/src/TestingTools.php +++ b/src/TestingTools.php @@ -2,7 +2,6 @@ namespace Illuminated\Testing; -use Illuminated\Testing\Asserts\ArtisanAsserts; use Illuminated\Testing\Asserts\CollectionAsserts; use Illuminated\Testing\Asserts\DatabaseAsserts; use Illuminated\Testing\Asserts\EloquentAsserts; @@ -13,15 +12,13 @@ use Illuminated\Testing\Asserts\ScheduleAsserts; use Illuminated\Testing\Asserts\ServiceProviderAsserts; use Illuminated\Testing\Helpers\ApplicationHelpers; -use Illuminated\Testing\Helpers\ArtisanHelpers; trait TestingTools { /** Helpers */ use ApplicationHelpers; - use ArtisanHelpers; + /** Asserts */ - use ArtisanAsserts; use CollectionAsserts; use DatabaseAsserts; use EloquentAsserts; diff --git a/tests/Asserts/ArtisanAssertsTest.php b/tests/Asserts/ArtisanAssertsTest.php deleted file mode 100644 index a953c71..0000000 --- a/tests/Asserts/ArtisanAssertsTest.php +++ /dev/null @@ -1,160 +0,0 @@ -willSeeConfirmation('Are you sure?', ConfirmationCommand::class); - } - - /** @test */ - public function which_also_works_with_confirmable_trait() - { - $this->willSeeConfirmation('Do you really wish to run this command?', ConfirmableTraitCommand::class); - } - - /** @test */ - public function it_has_will_not_see_confirmation_assertion() - { - $this->willNotSeeConfirmation('Are you sure?', GenericCommand::class); - } - - /** @test */ - public function it_has_will_give_confirmation_assertion() - { - $this->willGiveConfirmation('Are you sure?', ConfirmationCommand::class); - - $this->seeArtisanOutput('Done!'); - } - - /** @test */ - public function which_is_also_works_with_confirmable_trait() - { - $this->willGiveConfirmation('Do you really wish to run this command?', ConfirmableTraitCommand::class); - - $this->seeArtisanOutput(__DIR__ . '/ArtisanAssertsTest/confirmable.accepted.output.txt'); - } - - /** @test */ - public function it_has_will_not_give_confirmation_assertion() - { - $this->willNotGiveConfirmation('Are you sure?', ConfirmationCommand::class); - - $this->dontSeeArtisanOutput(__DIR__ . '/ArtisanAssertsTest/confirmable.accepted.output.txt'); - } - - /** @test */ - public function it_has_see_artisan_output_assertion() - { - $this->artisan('generic'); - - $this->seeArtisanOutput('Hello, World!'); - } - - /** @test */ - public function which_accepts_file_path_instead_of_string_output() - { - $this->artisan('generic'); - - $this->seeArtisanOutput(__DIR__ . '/ArtisanAssertsTest/generic.correct.output.txt'); - } - - /** @test */ - public function it_has_dont_see_artisan_output_assertion() - { - $this->artisan('generic'); - - $this->dontSeeArtisanOutput('Hello, Universe!'); - } - - /** @test */ - public function which_also_accepts_file_path_instead_of_string_output() - { - $this->artisan('generic'); - - $this->dontSeeArtisanOutput(__DIR__ . '/ArtisanAssertsTest/generic.incorrect.output.txt'); - } - - /** @test */ - public function it_has_see_in_artisan_output_assertion() - { - $this->artisan('table-output'); - - $this->seeInArtisanOutput('Node-2'); - } - - /** @test */ - public function which_accepts_file_path_instead_of_string_needle() - { - $this->artisan('table-output'); - - $this->seeInArtisanOutput(__DIR__ . '/ArtisanAssertsTest/table.needle.output.txt'); - } - - /** @test */ - public function it_has_dont_see_in_artisan_output_assertion() - { - $this->artisan('table-output'); - - $this->dontSeeInArtisanOutput('Hello'); - } - - /** @test */ - public function which_also_accepts_file_path_instead_of_string_needle() - { - $this->artisan('table-output'); - - $this->dontSeeInArtisanOutput(__DIR__ . '/ArtisanAssertsTest/table.wrong-needle.output.txt'); - } - - /** @test */ - public function it_has_see_artisan_table_output_assertion() - { - $this->artisan('table-output'); - - $this->seeArtisanTableOutput([ - ['System' => 'Node-1', 'Status' => 'Enabled'], - ['System' => 'Node-2', 'Status' => 'Enabled'], - ['System' => 'Node-3', 'Status' => 'Enabled'], - ]); - } - - /** @test */ - public function it_has_dont_see_artisan_table_output_assertion() - { - $this->artisan('table-output'); - - $this->dontSeeArtisanTableOutput([ - ['System' => 'Node-1', 'Status' => 'Disabled'], - ['System' => 'Node-2', 'Status' => 'Disabled'], - ['System' => 'Node-3', 'Status' => 'Disabled'], - ]); - } - - /** @test */ - public function it_has_see_artisan_table_rows_count_assertion() - { - $this->artisan('table-output'); - - $this->seeArtisanTableRowsCount(3); - } - - /** @test */ - public function it_has_dont_see_artisan_table_rows_count_assertion() - { - $this->artisan('table-output'); - - $this->dontSeeArtisanTableRowsCount(1); - $this->dontSeeArtisanTableRowsCount(2); - $this->dontSeeArtisanTableRowsCount(4); - $this->dontSeeArtisanTableRowsCount(5); - } -} diff --git a/tests/Asserts/ArtisanAssertsTest/confirmable.accepted.output.txt b/tests/Asserts/ArtisanAssertsTest/confirmable.accepted.output.txt deleted file mode 100644 index 0bf295f..0000000 --- a/tests/Asserts/ArtisanAssertsTest/confirmable.accepted.output.txt +++ /dev/null @@ -1,5 +0,0 @@ -****************************** -* Attention, please! * -****************************** - -Done! diff --git a/tests/Asserts/ArtisanAssertsTest/generic.correct.output.txt b/tests/Asserts/ArtisanAssertsTest/generic.correct.output.txt deleted file mode 100644 index 8ab686e..0000000 --- a/tests/Asserts/ArtisanAssertsTest/generic.correct.output.txt +++ /dev/null @@ -1 +0,0 @@ -Hello, World! diff --git a/tests/Asserts/ArtisanAssertsTest/generic.incorrect.output.txt b/tests/Asserts/ArtisanAssertsTest/generic.incorrect.output.txt deleted file mode 100644 index c643077..0000000 --- a/tests/Asserts/ArtisanAssertsTest/generic.incorrect.output.txt +++ /dev/null @@ -1 +0,0 @@ -Hello, Universe! diff --git a/tests/Asserts/ArtisanAssertsTest/table.needle.output.txt b/tests/Asserts/ArtisanAssertsTest/table.needle.output.txt deleted file mode 100644 index 4c10f7c..0000000 --- a/tests/Asserts/ArtisanAssertsTest/table.needle.output.txt +++ /dev/null @@ -1 +0,0 @@ -Node-2 \ No newline at end of file diff --git a/tests/Asserts/ArtisanAssertsTest/table.wrong-needle.output.txt b/tests/Asserts/ArtisanAssertsTest/table.wrong-needle.output.txt deleted file mode 100644 index 5ab2f8a..0000000 --- a/tests/Asserts/ArtisanAssertsTest/table.wrong-needle.output.txt +++ /dev/null @@ -1 +0,0 @@ -Hello \ No newline at end of file diff --git a/tests/Helpers/ArtisanHelpersTest.php b/tests/Helpers/ArtisanHelpersTest.php deleted file mode 100644 index 54a158e..0000000 --- a/tests/Helpers/ArtisanHelpersTest.php +++ /dev/null @@ -1,49 +0,0 @@ -runArtisan(GenericCommand::class); - - $this->assertInstanceOf(GenericCommand::class, $command); - $this->assertEquals('Hello, Dude!', $command->getGreetingMessage()); - } - - /** @test */ - public function it_can_run_artisan_command_by_class_name_and_parameters() - { - /** @var GenericCommand $command */ - $command = $this->runArtisan(GenericCommand::class, ['--name' => 'John']); - - $this->assertInstanceOf(GenericCommand::class, $command); - $this->assertEquals('Hello, John!', $command->getGreetingMessage()); - } - - /** @test */ - public function it_can_run_artisan_command_by_object() - { - /** @var GenericCommand $command */ - $command = $this->runArtisan(new GenericCommand); - - $this->assertInstanceOf(GenericCommand::class, $command); - $this->assertEquals('Hello, Dude!', $command->getGreetingMessage()); - } - - /** @test */ - public function it_can_run_artisan_command_by_object_and_parameters() - { - /** @var GenericCommand $command */ - $command = $this->runArtisan(new GenericCommand, ['--name' => 'Jane']); - - $this->assertInstanceOf(GenericCommand::class, $command); - $this->assertEquals('Hello, Jane!', $command->getGreetingMessage()); - } -} diff --git a/tests/TestCase.php b/tests/TestCase.php index 8f7f7ed..8b708c3 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -12,13 +12,6 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase { use TestingTools; - /** - * Indicates if the console output should be mocked. - * - * @var bool - */ - public $mockConsoleOutput = false; - /** * Setup the test environment. */ @@ -55,8 +48,7 @@ protected function setUpDatabase(): void '--database' => 'testing', '--realpath' => true, '--path' => __DIR__ . '/fixture/database/migrations/', - ]); - $this->seeInArtisanOutput('Migrated'); + ])->assertSuccessful(); } /** diff --git a/tests/TestingToolsTest.php b/tests/TestingToolsTest.php index d86baae..7f807e6 100644 --- a/tests/TestingToolsTest.php +++ b/tests/TestingToolsTest.php @@ -2,7 +2,6 @@ namespace Illuminated\Testing\Tests; -use Illuminated\Testing\Asserts\ArtisanAsserts; use Illuminated\Testing\Asserts\CollectionAsserts; use Illuminated\Testing\Asserts\DatabaseAsserts; use Illuminated\Testing\Asserts\EloquentAsserts; @@ -13,7 +12,6 @@ use Illuminated\Testing\Asserts\ScheduleAsserts; use Illuminated\Testing\Asserts\ServiceProviderAsserts; use Illuminated\Testing\Helpers\ApplicationHelpers; -use Illuminated\Testing\Helpers\ArtisanHelpers; use Illuminated\Testing\TestingTools; class TestingToolsTest extends TestCase @@ -22,13 +20,11 @@ class TestingToolsTest extends TestCase public function it_is_using_all_testing_tools_helpers() { $this->assertTraitUsed(TestingTools::class, ApplicationHelpers::class); - $this->assertTraitUsed(TestingTools::class, ArtisanHelpers::class); } /** @test */ public function it_is_using_all_testing_tools_asserts() { - $this->assertTraitUsed(TestingTools::class, ArtisanAsserts::class); $this->assertTraitUsed(TestingTools::class, CollectionAsserts::class); $this->assertTraitUsed(TestingTools::class, DatabaseAsserts::class); $this->assertTraitUsed(TestingTools::class, EloquentAsserts::class); diff --git a/tests/fixture/app/Console/Commands/ConfirmableTraitCommand.php b/tests/fixture/app/Console/Commands/ConfirmableTraitCommand.php deleted file mode 100644 index abdf399..0000000 --- a/tests/fixture/app/Console/Commands/ConfirmableTraitCommand.php +++ /dev/null @@ -1,30 +0,0 @@ -confirmToProceed('Attention, please!', true)) { - return; - } - - $this->info('Done!'); - } -} diff --git a/tests/fixture/app/Console/Commands/ConfirmationCommand.php b/tests/fixture/app/Console/Commands/ConfirmationCommand.php deleted file mode 100644 index ebe837c..0000000 --- a/tests/fixture/app/Console/Commands/ConfirmationCommand.php +++ /dev/null @@ -1,27 +0,0 @@ -confirm('Are you sure?')) { - return; - } - - $this->info('Done!'); - } -} diff --git a/tests/fixture/app/Console/Commands/GenericCommand.php b/tests/fixture/app/Console/Commands/GenericCommand.php deleted file mode 100644 index 7ec4598..0000000 --- a/tests/fixture/app/Console/Commands/GenericCommand.php +++ /dev/null @@ -1,33 +0,0 @@ -info('Hello, World!'); - } - - /** - * Get the greeting message. - */ - public function getGreetingMessage(): string - { - $name = $this->option('name') ?: 'Dude'; - - return "Hello, {$name}!"; - } -} diff --git a/tests/fixture/app/Console/Commands/TableOutputCommand.php b/tests/fixture/app/Console/Commands/TableOutputCommand.php deleted file mode 100644 index 65730e3..0000000 --- a/tests/fixture/app/Console/Commands/TableOutputCommand.php +++ /dev/null @@ -1,37 +0,0 @@ -getRows(); - $headers = array_keys($rows[0]); - $this->table($headers, $rows); - } - - /** - * Get the rows. - */ - private function getRows(): array - { - return [ - ['System' => 'Node-1', 'Status' => 'Enabled'], - ['System' => 'Node-2', 'Status' => 'Enabled'], - ['System' => 'Node-3', 'Status' => 'Enabled'], - ]; - } -} diff --git a/tests/fixture/app/Console/Kernel.php b/tests/fixture/app/Console/Kernel.php index 4807e39..04211c1 100644 --- a/tests/fixture/app/Console/Kernel.php +++ b/tests/fixture/app/Console/Kernel.php @@ -2,22 +2,6 @@ namespace Illuminated\Testing\Tests\App\Console; -use Illuminated\Testing\Tests\App\Console\Commands\ConfirmableTraitCommand; -use Illuminated\Testing\Tests\App\Console\Commands\ConfirmationCommand; -use Illuminated\Testing\Tests\App\Console\Commands\GenericCommand; -use Illuminated\Testing\Tests\App\Console\Commands\TableOutputCommand; - class Kernel extends \Orchestra\Testbench\Foundation\Console\Kernel { - /** - * The Artisan commands provided by the application. - * - * @var array - */ - protected $commands = [ - GenericCommand::class, - TableOutputCommand::class, - ConfirmationCommand::class, - ConfirmableTraitCommand::class, - ]; }