aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2022-01-29 23:08:09 +0100
committerGravatar GitHub <noreply@github.com> 2022-01-29 23:08:09 +0100
commit24afafb74d422bd8d7526719046253279cb7e713 (patch)
treea6345ff91f3b735dffb95373a3715d15f71e100e /tests
parent8808fb4545d467f62fc82886d9f86bc63c8cf962 (diff)
Clean temp files MigratorTest (#4177)
The automated tests used to generate several temporary files not deleted...
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Minz/MigratorTest.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/lib/Minz/MigratorTest.php b/tests/lib/Minz/MigratorTest.php
index 6cc4b4a94..bcee45204 100644
--- a/tests/lib/Minz/MigratorTest.php
+++ b/tests/lib/Minz/MigratorTest.php
@@ -268,6 +268,7 @@ class MigratorTest extends TestCase
$this->assertTrue($result);
$versions = file_get_contents($applied_migrations_path);
$this->assertSame("2019_12_22_FooBar\n2019_12_23_Baz", $versions);
+ @unlink($applied_migrations_path);
}
public function testExecuteWithAlreadyAppliedMigration() {
@@ -280,6 +281,7 @@ class MigratorTest extends TestCase
$this->assertTrue($result);
$versions = file_get_contents($applied_migrations_path);
$this->assertSame("2019_12_22_FooBar\n2019_12_23_Baz", $versions);
+ @unlink($applied_migrations_path);
}
public function testExecuteWithAppliedMigrationInDifferentOrder() {
@@ -294,6 +296,7 @@ class MigratorTest extends TestCase
// if the order changes, it probably means the first versions comparison
// test doesn't work anymore
$this->assertSame("2019_12_23_Baz\n2019_12_22_FooBar", $versions);
+ @unlink($applied_migrations_path);
}
public function testExecuteFailsIfVersionPathDoesNotExist() {
@@ -305,6 +308,7 @@ class MigratorTest extends TestCase
$result = Minz_Migrator::execute($migrations_path, $applied_migrations_path);
$this->assertSame($expected_result, $result);
+ @unlink($applied_migrations_path);
}
public function testExecuteFailsIfAMigrationIsFailing() {
@@ -318,5 +322,6 @@ class MigratorTest extends TestCase
$this->assertSame($expected_result, $result);
$versions = file_get_contents($applied_migrations_path);
$this->assertSame('2020_01_11_FooBar', $versions);
+ @unlink($applied_migrations_path);
}
}