Skip to content
Permalink
Browse files

Fixnishing stub test case

  • Loading branch information...
lorenzo committed Jul 2, 2015
1 parent 71dd2d6 commit 7ca6baf5103615650583ad612e31aa90d2ffe44a
Showing with 18 additions and 3 deletions.
  1. +18 −3 tests/TestCase/ORM/BindingKeyTest.php
@@ -33,6 +33,11 @@ class BindingKeyTest extends TestCase
'core.auth_users'
];
/**
* Tests that bindingKey can be used in belongsTo associations
*
* @return void
*/
public function testBelongsto()
{
$users = TableRegistry::get('Users');
@@ -43,8 +48,18 @@ public function testBelongsto()
$result = $users->find()
->contain(['AuthUsers']);
debug($result);
debug($result->toArray());
}
$expected = ['mariano', 'nate', 'larry', 'garrett'];
$expected = array_combine($expected, $expected);
$this->assertEquals(
$expected,
$result->combine('username', 'auth_user.username')->toArray()
);
$expected = [1 => 1, 2 => 5, 3 => 2, 4 => 4];
$this->assertEquals(
$expected,
$result->combine('id', 'auth_user.id')->toArray()
);
}
}

0 comments on commit 7ca6baf

Please sign in to comment.
You can’t perform that action at this time.