Skip to content

Commit

Permalink
Add functional test for dry run mode
Browse files Browse the repository at this point in the history
  • Loading branch information
guvra committed Jun 6, 2024
1 parent 384386b commit c6f0fd2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/.idea
/build
/docker/db-data
/tests/functional/Resources/var
/vendor
/.env
/.phpunit.result.cache
Expand Down
19 changes: 18 additions & 1 deletion tests/functional/Dumper/MysqlDumperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class MysqlDumperTest extends TestCase
*/
protected function setUp(): void
{
$this->dumpFile = $this->getResource('db/dump.sql');
$this->dumpFile = $this->getResource('var/dump.sql');
}

/**
Expand Down Expand Up @@ -54,6 +54,23 @@ public function testDumper(): void
$this->assertDumpIsValid(false);
}

/**
* Assert that the dry run mode works properly.
*/
public function testDryRun(): void
{
$config = $this->createConfig();
$dumper = $this->createDumper();

// Make sure the dump file does not exist
if (file_exists($this->dumpFile)) {
unlink($this->dumpFile);
}

$dumper->dump($config, true);
$this->assertFileDoesNotExist($this->dumpFile);
}

/**
* Assert that the dump file contents match the dump configuration file.
*/
Expand Down
Empty file.

0 comments on commit c6f0fd2

Please sign in to comment.