Skip to content

Commit

Permalink
Updated tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilge committed Jun 22, 2020
1 parent ef8002a commit aede0b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/Phinx/Migration/Migration.template.php.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php
declare(strict_types=1);

$namespaceDefinition
use $useClassName;

Expand Down
5 changes: 2 additions & 3 deletions tests/Phinx/Console/Command/CreateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function testCreateMigrationDefault(): void
$this->assertRegExp("/^[0-9]{14}.php/", $fileName);
$date = substr($fileName, 0, 14);
$this->assertFileExists($this->config->getMigrationPaths()[0]);
$prefix = "<?php\n\nuse Phinx\\Migration\\AbstractMigration;\n\nclass V{$date} extends AbstractMigration";
$prefix = "<?php\ndeclare(strict_types=1);\n\nuse Phinx\\Migration\\AbstractMigration;\n\nfinal class V{$date} extends AbstractMigration\n";
$this->assertStringStartsWith($prefix, file_get_contents($this->config->getMigrationPaths()[0] . DIRECTORY_SEPARATOR . $fileName));
}

Expand All @@ -125,9 +125,8 @@ public function testCreateMigrationWithName(): void
$this->assertCount(1, $files);
$fileName = current($files);
$this->assertRegExp("/^[0-9]{14}_my_migration.php/", $fileName);
$date = substr($fileName, 0, 14);
$this->assertFileExists($this->config->getMigrationPaths()[0]);
$prefix = "<?php\n\nuse Phinx\\Migration\\AbstractMigration;\n\nclass MyMigration extends AbstractMigration";
$prefix = "<?php\ndeclare(strict_types=1);\n\nuse Phinx\\Migration\\AbstractMigration;\n\nfinal class MyMigration extends AbstractMigration";
$this->assertStringStartsWith($prefix, file_get_contents($this->config->getMigrationPaths()[0] . DIRECTORY_SEPARATOR . $fileName));
}

Expand Down

0 comments on commit aede0b9

Please sign in to comment.