diff --git a/src/TestSuite/TestCase.php b/src/TestSuite/TestCase.php index fe75054e949..ce516e478f4 100644 --- a/src/TestSuite/TestCase.php +++ b/src/TestSuite/TestCase.php @@ -667,8 +667,8 @@ public function getMockForModel($alias, array $methods = [], array $options = [] } } - if (stripos($mock->table(), 'mock') === 0) { - $mock->table(Inflector::tableize($baseClass)); + if (stripos($mock->getTable(), 'mock') === 0) { + $mock->setTable(Inflector::tableize($baseClass)); } TableRegistry::set($baseClass, $mock);