From 09ae5fb595eb2ee1be97bf7ef83ffc9b3349ce3c Mon Sep 17 00:00:00 2001 From: Anton Andersen Date: Mon, 8 Sep 2014 13:52:11 +0400 Subject: [PATCH 1/2] Make unit tests cleanup a DB after finish --- extensions/codeception/TestCase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/codeception/TestCase.php b/extensions/codeception/TestCase.php index a810cb6e51..fa51d88de4 100644 --- a/extensions/codeception/TestCase.php +++ b/extensions/codeception/TestCase.php @@ -80,7 +80,6 @@ class TestCase extends Test { parent::setUp(); $this->mockApplication(); - $this->unloadFixtures(); $this->loadFixtures(); } @@ -90,6 +89,7 @@ class TestCase extends Test protected function tearDown() { $this->destroyApplication(); + $this->unloadFixtures(); parent::tearDown(); } From 8e66325fa16ee0b18366e9d7343c05d9c87be009 Mon Sep 17 00:00:00 2001 From: Anton Andersen Date: Mon, 8 Sep 2014 15:04:42 +0400 Subject: [PATCH 2/2] Return a fixtures cleanup in case of a failing test --- extensions/codeception/TestCase.php | 1 + 1 file changed, 1 insertion(+) diff --git a/extensions/codeception/TestCase.php b/extensions/codeception/TestCase.php index fa51d88de4..222df448a0 100644 --- a/extensions/codeception/TestCase.php +++ b/extensions/codeception/TestCase.php @@ -80,6 +80,7 @@ class TestCase extends Test { parent::setUp(); $this->mockApplication(); + $this->unloadFixtures(); $this->loadFixtures(); }