Skip to content

Commit

Permalink
Fix primary key test.
Browse files Browse the repository at this point in the history
Without tables/schemas set up properly, the primary key check will
always use the `Articles` tables schema for retrieving the foreign
key constraint.
  • Loading branch information
ndm2 committed Feb 17, 2017
1 parent 872fd9b commit 10596b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/TestCase/View/Form/EntityContextTest.php
Expand Up @@ -102,6 +102,8 @@ public function testPrimaryKey()
*/
public function testIsPrimaryKey()
{
$this->_setupTables();

$row = new Article();
$context = new EntityContext($this->request, [
'entity' => $row,
Expand Down Expand Up @@ -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],
Expand Down

0 comments on commit 10596b8

Please sign in to comment.