Skip to content

Commit 782e73f

Browse files
oliverkleeSam Tuke
authored andcommitted
[BUGFIX] Always truncate the DB tables after an integration test (#86)
1 parent 7231f92 commit 782e73f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Tests/Integration/Controller/AbstractControllerTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
use PhpList\PhpList4\Core\Environment;
99
use PHPUnit\DbUnit\Database\Connection;
1010
use PHPUnit\DbUnit\DataSet\CsvDataSet;
11+
use PHPUnit\DbUnit\Operation\Factory;
12+
use PHPUnit\DbUnit\Operation\Operation;
1113
use PHPUnit\DbUnit\TestCaseTrait;
1214
use Symfony\Bundle\FrameworkBundle\Client;
1315
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
@@ -107,6 +109,16 @@ protected function tearDown()
107109
Bootstrap::purgeInstance();
108110
}
109111

112+
/**
113+
* Returns the database operation executed in test cleanup.
114+
*
115+
* @return Operation
116+
*/
117+
protected function getTearDownOperation(): Operation
118+
{
119+
return Factory::TRUNCATE();
120+
}
121+
110122
/**
111123
* Returns the test database connection.
112124
*

0 commit comments

Comments
 (0)