diff --git a/src/View/Form/EntityContext.php b/src/View/Form/EntityContext.php index 6a6d13ff4f4..bfd2c4376f6 100644 --- a/src/View/Form/EntityContext.php +++ b/src/View/Form/EntityContext.php @@ -155,6 +155,7 @@ public function val($field) { * * @param array $path The path to traverse to find the leaf entity. * @return array + * @throws \RuntimeException When properties cannot be read. */ protected function _getEntity($path) { $entity = $this->_context['entity']; diff --git a/tests/TestCase/View/Form/EntityContextTest.php b/tests/TestCase/View/Form/EntityContextTest.php index 298ef1cc2b1..70611f25da0 100644 --- a/tests/TestCase/View/Form/EntityContextTest.php +++ b/tests/TestCase/View/Form/EntityContextTest.php @@ -14,6 +14,8 @@ */ namespace Cake\Test\TestCase\View\Form; +use ArrayIterator; +use ArrayObject; use Cake\Collection\Collection; use Cake\Network\Request; use Cake\ORM\Entity; @@ -22,8 +24,6 @@ use Cake\TestSuite\TestCase; use Cake\Validation\Validator; use Cake\View\Form\EntityContext; -use ArrayIterator; -use ArrayObject; /** * Test stub.