Skip to content

Commit

Permalink
fix tests after change to Migrations class
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyvankooten committed Nov 18, 2024
1 parent dd2f931 commit a64f3e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
14 changes: 2 additions & 12 deletions tests/MigrationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,10 @@ public function setUp() : void
}
}

public function test_find_migrations()
public function testCanInstantiate()
{
$instance = new Migrations('1.0', '1.1', $this->dir);
self::assertEquals($instance->find_migrations(), array());

// create correct migration file
$migration_file = $this->dir . '/1.1-do-something.php';
file_put_contents($migration_file, '');
self::assertEquals($instance->find_migrations(), array( $migration_file ));

// create incorrect migrations file
$older_migration_file = $this->dir . '/1.0-do-something.php';
file_put_contents($older_migration_file, '');
self::assertEquals($instance->find_migrations(), array( $migration_file ));
$this->assertInstanceOf(Migrations::class, $instance);
}

public function tearDown() : void
Expand Down
2 changes: 2 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ function add_filter($a, $b, $c = 10, $d = 1) {}
function add_shortcode($a, $b) {}
function number_format_i18n($number, $decimals = 0) { return $number; }
function register_activation_hook($a, $b) {}
function update_option($a, $b, $c = false) {}
function get_option($a, $b, $c = false) {}

0 comments on commit a64f3e8

Please sign in to comment.