/** * @test */ public function cleanUpWithDeepCleanup() { // Creates a dummy record (and marks that table as dirty). $this->fixture->createRecord('tx_phpunit_test'); // Creates a dummy record directly in the database without putting this // table name to the list of dirty tables. Tx_Phpunit_Service_Database::insert('tx_phpunit_test_article_mm', array('is_dummy_record' => 1)); // Deletes all dummy records. $this->fixture->cleanUp(TRUE); // Checks whether ALL dummy records were deleted (independent of the // list of dirty tables). $allowedTables = $this->fixture->getListOfDirtyTables(); foreach ($allowedTables as $currentTable) { $this->assertSame(0, $this->fixture->countRecords($currentTable), 'Some test records were not deleted from table "' . $currentTable . '"'); } }