From f760c9a875b1bb8a9d4cf7463856655c421faed6 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Mon, 5 Feb 2018 19:41:24 +0100 Subject: [PATCH] [BUGFIX] Always truncate the DB tables after an integration test --- .../Controller/AbstractControllerTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Tests/Integration/Controller/AbstractControllerTest.php b/Tests/Integration/Controller/AbstractControllerTest.php index bf35951..c674b17 100644 --- a/Tests/Integration/Controller/AbstractControllerTest.php +++ b/Tests/Integration/Controller/AbstractControllerTest.php @@ -8,6 +8,8 @@ use PhpList\PhpList4\Core\Environment; use PHPUnit\DbUnit\Database\Connection; use PHPUnit\DbUnit\DataSet\CsvDataSet; +use PHPUnit\DbUnit\Operation\Factory; +use PHPUnit\DbUnit\Operation\Operation; use PHPUnit\DbUnit\TestCaseTrait; use Symfony\Bundle\FrameworkBundle\Client; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; @@ -107,6 +109,16 @@ protected function tearDown() Bootstrap::purgeInstance(); } + /** + * Returns the database operation executed in test cleanup. + * + * @return Operation + */ + protected function getTearDownOperation(): Operation + { + return Factory::TRUNCATE(); + } + /** * Returns the test database connection. *