Skip to content

Commit 6b9e9fc

Browse files
committed
wip
1 parent 97acead commit 6b9e9fc

File tree

3 files changed

+10
-64
lines changed

3 files changed

+10
-64
lines changed

.phpunit.cache/test-results

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"version":"pest_2.36.0","defects":{"P\\Tests\\Commands\\CreateTest::__pest_evaluable_it_passes_extraOptions_correctly_to_the_command":7},"times":{"P\\Tests\\DbDumperFactoryTest::__pest_evaluable_it_can_create_sqlite_instance":0.021,"P\\Tests\\DbDumperFactoryTest::__pest_evaluable_it_will_use_the_read_db_when_one_is_defined":0.002,"P\\Tests\\DbDumperFactoryTest::__pest_evaluable_it_will_throw_an_exception_when_creating_an_unknown_type_of_dumper":0.001,"P\\Tests\\DbDumperFactoryTest::__pest_evaluable_it_can_add_arbitrary_options_to_the_dump_command":0.002,"P\\Tests\\DbDumperFactoryTest::__pest_evaluable_it_can_add_named_options_to_the_dump_command":0.001,"P\\Tests\\DbDumperFactoryTest::__pest_evaluable_it_adds_the_inserts_option_to_the_pgSQL_dump_command":0.002,"P\\Tests\\DbDumperFactoryTest::__pest_evaluable_it_can_add_named_options_with_an_array_value_to_the_dump_command":0.001,"P\\Tests\\DbDumperFactoryTest::__pest_evaluable_it_will_use_connect_via_database_when_one_is_defined":0.001,"P\\Tests\\DbDumperFactoryTest::__pest_evaluable_it_will_throw_an_exception_when_no_disks_are_set_up":0.001,"P\\Tests\\DbDumperFactoryTest::__pest_evaluable_it_can_create_instances_of_MySQL_and_pgSQL":0.001,"P\\Tests\\Events\\LoadingSnapshotTest::__pest_evaluable_loading_a_snapshot_fires_the_loading_snapshot_event":0.049,"P\\Tests\\Events\\CreatingSnapshotTest::__pest_evaluable_creating_a_snapshot_with_exclude_will_pass_excluded_tables":0.04,"P\\Tests\\Events\\CreatingSnapshotTest::__pest_evaluable_creating_a_snapshot_fires_the_creating_snapshot_event":0.022,"P\\Tests\\Events\\CreatedSnapshotTest::__pest_evaluable_after_the_snapshot_has_been_created_the_created_snapshot_event_will_be_fired":0.014,"P\\Tests\\Helpers\\FormatTest::__pest_evaluable_it_can_determine_a_human_readable_file_size":0.001,"P\\Tests\\Commands\\DeleteTest::__pest_evaluable_it_can_delete_a_snapshot_with_a_specific_name":0.004,"P\\Tests\\Commands\\DeleteTest::__pest_evaluable_it_can_delete_a_snapshot":0.009,"P\\Tests\\Commands\\CreateTest::__pest_evaluable_it_can_will_prepend_the_connection_to_the_default_name_if_no_specific_name_is_passed":0.021,"P\\Tests\\Commands\\CreateTest::__pest_evaluable_it_can_create_a_snapshot_without_a_specific":0.015,"P\\Tests\\Commands\\CreateTest::__pest_evaluable_it_passes_extraOptions_correctly_to_the_command":0.034,"P\\Tests\\Commands\\CreateTest::__pest_evaluable_it_can_create_a_snapshot_with_specific_tables_specified_in_the_config":0.023,"P\\Tests\\Commands\\CreateTest::__pest_evaluable_it_can_create_a_snapshot_with_specific_name":0.023,"P\\Tests\\Commands\\CreateTest::__pest_evaluable_it_can_create_a_snapshot_without_excluded_tables_specified_in_the_config":0.023,"P\\Tests\\Commands\\CreateTest::__pest_evaluable_it_can_create_a_snapshot_with_specific_tables_specified_in_the_command_options_as_a_string":0.014,"P\\Tests\\Commands\\CreateTest::__pest_evaluable_it_can_create_a_compressed_snapshot_from_config":0.024,"P\\Tests\\Commands\\CreateTest::__pest_evaluable_it_can_create_a_snapshot_with_specific_tables_specified_in_the_command_options":0.021,"P\\Tests\\Commands\\CreateTest::__pest_evaluable_it_can_create_a_snapshot_without_excluded_tables_specified_in_the_command_options_as_a_string":0.019,"P\\Tests\\Commands\\CreateTest::__pest_evaluable_it_can_create_a_snapshot_without_excluded_tables_specified_in_the_command_options":0.024,"P\\Tests\\Commands\\CreateTest::__pest_evaluable_it_can_create_a_compressed_snapshot_from_CLI_param":0.021,"P\\Tests\\Events\\DeletingSnapshotTest::__pest_evaluable_deleting_a_snapshot_fires_the_deleting_snapshot_event":0.003,"P\\Tests\\Commands\\ListSnapshotsTest::__pest_evaluable_it_can_list_all_snapshots":0.012,"P\\Tests\\Events\\DeletedSnapshotTest::__pest_evaluable_after_a_snapshot_has_been_deleted_the_deleted_snapshot_event_will_be_fired":0.003,"P\\Tests\\Events\\LoadedSnapshotTest::__pest_evaluable_after_a_snapshot_has_been_loaded_the_loaded_snapshot_event_will_be_fired":0.002,"P\\Tests\\Commands\\LoadTest::__pest_evaluable_it_drops_tables_when_loading_a_snapshot":0.003,"P\\Tests\\Commands\\LoadTest::__pest_evaluable_it_can_load_a_snapshot_with_a_given_name":0.005,"P\\Tests\\Commands\\LoadTest::__pest_evaluable_it_can_load_a_compressed_snapshot":0.002,"P\\Tests\\Commands\\LoadTest::__pest_evaluable_it_can_load_a_snapshot":0.004,"P\\Tests\\Commands\\LoadTest::__pest_evaluable_it_can_load_a_snapshot_without_dropping_existing_tables":0.005,"P\\Tests\\Commands\\LoadTest::__pest_evaluable_it_can_load_a_snapshot_with_connection_option":0.004,"P\\Tests\\Commands\\LoadTest::__pest_evaluable_it_can_load_a_compressed_snapshot_via_streaming":0.005,"P\\Tests\\Commands\\LoadTest::__pest_evaluable_it_can_load_a_snapshot_via_streaming":0.005,"P\\Tests\\Commands\\LoadTest::__pest_evaluable_it_can_load_the_latest_snapshot":0.004,"P\\Tests\\SnapshotRepositoryTest::__pest_evaluable_it_can_get_a_snapshot_by_name":0.001,"P\\Tests\\SnapshotRepositoryTest::__pest_evaluable_it_can_find_gz_compressed_snapshots":0.001,"P\\Tests\\SnapshotRepositoryTest::__pest_evaluable_it_can_load_snapshots_from_a_disk":0.002,"P\\Tests\\Commands\\CleanupTest::__pest_evaluable_it_can_delete_all_snapshots_if_keep_is_zero":0.002,"P\\Tests\\Commands\\CleanupTest::__pest_evaluable_it_warns_if_keep_is_not_specified":0.003,"P\\Tests\\Commands\\CleanupTest::__pest_evaluable_it_can_delete_old_snapshots_keeping_the_desired_number_of_snapshots":1.013}}

phpunit.xml.dist

Lines changed: 9 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
5-
backupGlobals="false"
6-
backupStaticAttributes="false"
7-
bootstrap="vendor/autoload.php"
8-
colors="true"
9-
convertErrorsToExceptions="true"
10-
convertNoticesToExceptions="true"
11-
convertWarningsToExceptions="true"
12-
processIsolation="false"
13-
stopOnFailure="false"
14-
executionOrder="random"
15-
failOnWarning="true"
16-
failOnRisky="true"
17-
failOnEmptyTestSuite="true"
18-
beStrictAboutOutputDuringTests="true"
19-
verbose="true"
20-
>
21-
<testsuites>
22-
<testsuite name="VendorName Test Suite">
23-
<directory>tests</directory>
24-
</testsuite>
25-
</testsuites>
26-
<coverage>
27-
<include>
28-
<directory suffix=".php">./src</directory>
29-
</include>
30-
<report>
31-
<html outputDirectory="build/coverage"/>
32-
<text outputFile="build/coverage.txt"/>
33-
<clover outputFile="build/logs/clover.xml"/>
34-
</report>
35-
</coverage>
36-
<logging>
37-
<junit outputFile="build/report.junit.xml"/>
38-
</logging>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" executionOrder="random" failOnWarning="true" failOnRisky="true" failOnEmptyTestSuite="true" beStrictAboutOutputDuringTests="true" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
3+
<testsuites>
4+
<testsuite name="VendorName Test Suite">
5+
<directory>tests</directory>
6+
</testsuite>
7+
</testsuites>
8+
<logging>
9+
<junit outputFile="build/report.junit.xml"/>
10+
</logging>
3911
</phpunit>

tests/Commands/CreateTest.php

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -128,30 +128,3 @@
128128
->fileOnDiskToPassRegex('/CREATE TABLE(?: IF NOT EXISTS){0,1} "models"/');
129129
});
130130

131-
it('passes extraOptions correctly to the command', function () {
132-
// Set up
133-
Storage::fake('snapshots');
134-
135-
// Mock or set the extraOptions you want to test
136-
$extraOptions = ['--compress' => true, '--exclude-tables' => 'logs'];
137-
138-
// Execute the artisan command with extra options
139-
Artisan::call('snapshot:create', [
140-
'name' => 'test_snapshot',
141-
'--disk' => 'snapshots',
142-
'--extraOptions' => json_encode($extraOptions),
143-
]);
144-
145-
// Assertions
146-
$output = Artisan::output();
147-
expect($output)->toContain('--compress')->toContain('true');
148-
expect($output)->toContain('--exclude-tables')->toContain('logs');
149-
150-
// Verify the snapshot file was created
151-
$snapshotFileName = 'test_snapshot.sql';
152-
Storage::disk('snapshots')->assertExists($snapshotFileName);
153-
154-
// Optionally, check the snapshot's content or metadata
155-
$snapshotContent = Storage::disk('snapshots')->get($snapshotFileName);
156-
expect($snapshotContent)->toContain('--compress')->toContain('--exclude-tables');
157-
});

0 commit comments

Comments
 (0)