Skip to content
Permalink
Browse files

DB tests: truncate test table on test setup

  • Loading branch information...
iegupov committed Feb 22, 2019
1 parent 73a8e0b commit 0bb80cf4b2c51c8ca247613358f65b2b43ae36e8
@@ -101,6 +101,7 @@ public function setUp()
parent::setUp();
$this->initializeDatabase();
$this->truncateTestTable();
$this->assureTestTableIsEmpty();
}
@@ -264,16 +265,7 @@ protected function assertObjectHasAttributeWithValue($object, $attributeName, $a
protected function assureTestTableIsEmpty()
{
if (!$this->isEmptyTestTable()) {
$this->truncateTestTable();
}
$this->assertEmpty($this->fetchAllTestTableRows(), "Problem while truncating the table '" . self::TABLE_NAME . "'!");
}
protected function isEmptyTestTable()
{
return empty($this->fetchAllTestTableRows());
$this->assertEmpty($this->fetchAllTestTableRows(), "Table '" . self::TABLE_NAME . "' is empty");
}
protected function fetchAllTestTableRows()
@@ -1413,17 +1413,6 @@ protected function isEmptyTestTable()
return empty($this->fetchAllTestTableRows());
}
/**
* Helper methods to be used in all tests extending this class
*/
/**
* Assure, that the table oxdoctrinetest is empty. If it is not empty, the test will fail.
*/
protected function assureTestTableIsEmpty()
{
$this->assertEmpty($this->fetchAllTestTableRows(), "Table '" . self::TABLE_NAME . "' is empty");
}
/**
* Get an instance of ConfigFile based on a empty file.
*

0 comments on commit 0bb80cf

Please sign in to comment.
You can’t perform that action at this time.