Skip to content

Commit

Permalink
#2 - Move Migrations::resetStorage() into tearDown() method
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeckerson committed Feb 1, 2020
1 parent c3e8b94 commit 1f89e37
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 6 additions & 0 deletions tests/Integration/IntegrationTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Phalcon\Config;
use Phalcon\Db\Adapter\Pdo\AbstractPdo;
use Phalcon\Db\Adapter\PdoFactory;
use Phalcon\Migrations\Migrations;
use PHPUnit\Framework\TestCase;
use function Phalcon\Migrations\Tests\remove_dir;
use function Phalcon\Migrations\Tests\root_path;
Expand Down Expand Up @@ -61,6 +62,11 @@ public function tearDown(): void
* Cleanup Database
*/
$this->db->query('DROP DATABASE IF EXISTS `' . getenv('TEST_DB_DATABASE') . '`;');

/**
* Reset filename or DB connection
*/
Migrations::resetStorage();
}

protected function initializeDatabase(): AbstractPdo
Expand Down
2 changes: 0 additions & 2 deletions tests/Integration/Issue29Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ public function testIssue29(): void
'migrationsInDb' => true,
]);

Migrations::resetStorage();

$this->assertTrue($this->db->tableExists('tasks'));
$this->assertTrue($this->db->tableExists('task_jobs'));
$this->assertArrayHasKey('task_jobs_tasks_id_fk', $this->db->describeReferences('task_jobs'));
Expand Down

0 comments on commit 1f89e37

Please sign in to comment.