Skip to content

Commit 4451391

Browse files
committed
hot fix
1 parent 55e18ba commit 4451391

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

tests/Feature/GenerateFromDbmlCommandTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Carbon\Carbon;
66
use Illuminate\Console\Command;
77
use Illuminate\Filesystem\Filesystem;
8+
use function Pest\Laravel\artisan;
89

910
it('generates models and migrations from DBML', function () {
1011
$filesystem = new Filesystem;
@@ -27,7 +28,7 @@
2728
try {
2829
$fixture = __DIR__.'/../Fixtures/simple.dbml';
2930

30-
$this->artisan('generate:dbml', ['file' => $fixture, '--force' => true])
31+
artisan('generate:dbml', ['file' => $fixture, '--force' => true])
3132
->assertExitCode(Command::SUCCESS);
3233

3334
expect(file_exists($appPath.'/Models/User.php'))->toBeTrue();
@@ -55,7 +56,7 @@
5556
it('fails when DBML file is missing', function () {
5657
$missing = base_path('tests/Fixtures/missing-file.dbml');
5758

58-
$this->artisan('generate:dbml', ['file' => $missing])
59+
artisan('generate:dbml', ['file' => $missing])
5960
->expectsOutput("File not found: $missing")
6061
->assertExitCode(Command::FAILURE);
6162
});

tests/TestCase.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@
44

55
use Egyjs\DbmlToLaravel\DbmlToLaravelServiceProvider;
66
use Illuminate\Database\Eloquent\Factories\Factory;
7+
use Illuminate\Testing\TestResponse;
78
use Orchestra\Testbench\TestCase as Orchestra;
89

910
class TestCase extends Orchestra
1011
{
12+
/**
13+
* Holds the latest HTTP/test response so Testbench can reset it between tests.
14+
*/
15+
protected static ?TestResponse $latestResponse = null;
16+
1117
protected function setUp(): void
1218
{
1319
parent::setUp();

0 commit comments

Comments
 (0)