Skip to content
Permalink
Browse files

Added failing test to prove #4019

  • Loading branch information...
lorenzo committed Jul 19, 2014
1 parent 48ca3de commit 661ddf8023947fb2a4458a57946f4dc0805fcaf9
Showing with 20 additions and 0 deletions.
  1. +20 −0 tests/TestCase/View/Form/EntityContextTest.php
@@ -465,6 +465,26 @@ public function testValAssociated() {
$this->assertNull($result);
}
/**
* Tests that trying to get values from missing associations returns null
*
* @return void
*/
public function testValMissingAssociation() {
$row = new Article([
'id' => 1
]);
$context = new EntityContext($this->request, [
'entity' => $row,
'table' => 'Articles',
]);
$result = $context->val('id');
$this->assertEquals($row->id, $result);
$this->assertNull($context->val('profile.id'));
}
/**
* Test reading values from associated entities.
*

0 comments on commit 661ddf8

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