Browse Source

Fixtures: Truncate instead of drop if schema defined in database table

Issue #14958
Jonathan McAndrew 5 years ago
parent
commit
ca40b6e972

+ 1 - 1
src/TestSuite/Fixture/TestFixture.php

@@ -310,7 +310,7 @@ class TestFixture implements ConstraintsInterface, FixtureInterface, TableSchema
         }
 
         if (empty($this->import) && empty($this->fields)) {
-            return true;
+            return $this->truncate($db);
         }
 
         try {

+ 0 - 1
tests/TestCase/TestSuite/TestFixtureTest.php

@@ -178,7 +178,6 @@ class TestFixtureTest extends TestCase
         $this->assertSame(['id', 'letter'], $fixture->getTableSchema()->columns());
 
         $db = $this->getMockBuilder('Cake\Database\Connection')
-            ->onlyMethods(['prepare', 'execute'])
             ->disableOriginalConstructor()
             ->getMock();
         $db->expects($this->never())