Skip to content
Permalink
Browse files

Fixed to account for keys including numeric values above 9

  • Loading branch information...
lilHermit committed Aug 7, 2017
1 parent a33a035 commit c956a926db5bf0651db346489303662388506803
Showing with 3 additions and 2 deletions.
  1. +1 −1 src/View/Form/ArrayContext.php
  2. +2 −1 tests/TestCase/View/Form/ArrayContextTest.php
@@ -299,6 +299,6 @@ public function error($field)
*/
protected function stripNesting($field)
{
return preg_replace('/\.\d\./', '.', $field);
return preg_replace('/\.\d*\./', '.', $field);
}
}
@@ -185,7 +185,8 @@ public function testValDefault()
$this->assertEquals('Default value', $context->val('title'));
$this->assertEquals('common1', $context->val('users.0.tags'));
$this->assertEquals('common2', $context->val('users.0.9tags'));
$this->assertEquals('common1', $context->val('users.99.tags'));
$this->assertEquals('common2', $context->val('users.9.9tags'));
$result = $context->val('title', ['default' => 'explicit default']);
$this->assertEquals('explicit default', $result);
}

0 comments on commit c956a92

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.