We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 48ca3de commit 661ddf8Copy full SHA for 661ddf8
tests/TestCase/View/Form/EntityContextTest.php
@@ -465,6 +465,26 @@ public function testValAssociated() {
465
$this->assertNull($result);
466
}
467
468
+/**
469
+ * Tests that trying to get values from missing associations returns null
470
+ *
471
+ * @return void
472
+ */
473
+ public function testValMissingAssociation() {
474
+ $row = new Article([
475
+ 'id' => 1
476
+ ]);
477
+ $context = new EntityContext($this->request, [
478
+ 'entity' => $row,
479
+ 'table' => 'Articles',
480
481
+
482
+ $result = $context->val('id');
483
+ $this->assertEquals($row->id, $result);
484
485
+ $this->assertNull($context->val('profile.id'));
486
+ }
487
488
/**
489
* Test reading values from associated entities.
490
*
0 commit comments