Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix unpack error in ValidationRule.
Refs #10682
  • Loading branch information
markstory committed May 23, 2017
1 parent f9eb00b commit 7720913
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Validation/ValidationRule.php
Expand Up @@ -134,7 +134,7 @@ public function process($value, array $providers, array $context = [])
}

if ($this->_pass) {
$args = array_merge([$value], $this->_pass, [$context]);
$args = array_values(array_merge([$value], $this->_pass, [$context]));
$result = $callable(...$args);
} else {
$result = $callable($value, $context);
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Validation/ValidationRuleTest.php
Expand Up @@ -67,7 +67,7 @@ public function testCustomMethods()
$Rule = new ValidationRule(['rule' => 'willFail']);
$this->assertFalse($Rule->process($data, $providers, $context));

$Rule = new ValidationRule(['rule' => 'willPass']);
$Rule = new ValidationRule(['rule' => 'willPass', 'pass' => ['key' => 'value']]);
$this->assertTrue($Rule->process($data, $providers, $context));

$Rule = new ValidationRule(['rule' => 'willFail3']);
Expand Down

0 comments on commit 7720913

Please sign in to comment.