Skip to content

Commit b07dfcf

Browse files
Add test
1 parent 7d699b0 commit b07dfcf

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/Commands/CreateTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,20 @@
1919
->expect('test.sql')
2020
->fileOnDiskToPassRegex('/CREATE TABLE(?: IF NOT EXISTS){0,1} "models"/');
2121

22+
it('can will prepend the connection to the default name if no specific name is passed', function () {
23+
24+
config()->set('database.connections.second_connection', [
25+
'driver' => 'sqlite',
26+
'database' => __DIR__ . '/../temp/second_connection.sqlite',
27+
'prefix' => '',
28+
]);
29+
30+
Artisan::call('snapshot:create', ['--connection' => 'second_connection']);
31+
$fileName = 'second_connection_' . Carbon::now()->format('Y-m-d_H-i-s') . '.sql';
32+
33+
$this->disk->assertExists($fileName);
34+
});
35+
2236
it('can create a compressed snapshot from CLI param', function () {
2337
Artisan::call('snapshot:create', ['--compress' => true]);
2438

0 commit comments

Comments
 (0)