Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Commit

Permalink
make the idempotency test a bit more straightforward
Browse files Browse the repository at this point in the history
  • Loading branch information
fredemmott committed Jan 11, 2018
1 parent af3bec8 commit 71f2ce1
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions tests/MigrationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,24 +131,19 @@ classname<Migrations\BaseMigration> $migration,

$ast = $migration->migrateFile($file, $ast);
\file_put_contents($file, $ast->getCode());
$new_ast = $migration->migrateFile($file, $ast);

expect(
$migration->migrateFile($file, $ast)->getCode()
)->toBeSame(
expect($new_ast->getCode())->toBeSame(
$ast->getCode(),
'Migrating the AST twice should produce identical text to once',
);

expect(
$migration->migrateFile($file, $ast),
)->toEqual(
expect($new_ast)->toEqual(
$ast,
'Migrating the AST twice should get you an equal AST object',
);

expect(
$migration->migrateFile($file, $ast),
)->toBeSame(
expect($new_ast)->toBeSame(
$ast,
'Migrating the AST twice should get you the same AST object',
);
Expand Down

0 comments on commit 71f2ce1

Please sign in to comment.