diff --git a/tests/TestCase/View/Form/EntityContextTest.php b/tests/TestCase/View/Form/EntityContextTest.php index 4beff4cbe7d..c0c36a32329 100644 --- a/tests/TestCase/View/Form/EntityContextTest.php +++ b/tests/TestCase/View/Form/EntityContextTest.php @@ -102,6 +102,8 @@ public function testPrimaryKey() */ public function testIsPrimaryKey() { + $this->_setupTables(); + $row = new Article(); $context = new EntityContext($this->request, [ 'entity' => $row, @@ -1249,7 +1251,8 @@ protected function _setupTables() 'id' => ['type' => 'integer', 'length' => 11, 'null' => false], 'title' => ['type' => 'string', 'length' => 255], 'user_id' => ['type' => 'integer', 'length' => 11, 'null' => false], - 'body' => ['type' => 'crazy_text', 'baseType' => 'text'] + 'body' => ['type' => 'crazy_text', 'baseType' => 'text'], + '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]], ]); $users->schema([ 'id' => ['type' => 'integer', 'length' => 11],