Skip to content

Commit

Permalink
test(commands): add test for ScoreCommand
Browse files Browse the repository at this point in the history
- Added a new test file ScoreCommandTest.php
- Added a test case to check the scores of given SQL statements
- Used Pest Laravel for testing framework
  • Loading branch information
guanguans committed Jun 6, 2024
1 parent 1648268 commit 2a8a473
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/Commands/ScoreCommandTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

declare(strict_types=1);

/**
* This file is part of the guanguans/laravel-soar.
*
* (c) guanguans <[email protected]>
*
* This source file is subject to the MIT license that is bundled.
*/

namespace Tests\Facades;

use Guanguans\LaravelSoar\Commands\ScoreCommand;
use Symfony\Component\Console\Command\Command;

use function Pest\Laravel\artisan;

it('can get the scores of the given SQL statements', function (): void {
artisan(ScoreCommand::class)
->expectsQuestion('Please input the SQL statements', 'select * from foo; select * from bar;')
->assertExitCode(Command::SUCCESS);
})->group(__DIR__, __FILE__);

0 comments on commit 2a8a473

Please sign in to comment.