Skip to content

Commit

Permalink
Merge branch '3.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Nov 15, 2012
2 parents c5ebbe7 + 885c7d2 commit ff5fa87
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
5 changes: 3 additions & 2 deletions PHPUnit/Framework/Assert.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public static function assertArrayHasKey($key, $array, $message = '')
}
if (!(is_array($array) || $array instanceof ArrayAccess)) {
throw PHPUnit_Util_InvalidArgumentHelper::factory(
1, 'array or ArrayAccess'
2, 'array or ArrayAccess'
);
}

Expand All @@ -104,7 +104,7 @@ public static function assertArrayNotHasKey($key, $array, $message = '')
}
if (!(is_array($array) || $array instanceof ArrayAccess)) {
throw PHPUnit_Util_InvalidArgumentHelper::factory(
1, 'array or ArrayAccess'
2, 'array or ArrayAccess'
);
}

Expand Down Expand Up @@ -2376,6 +2376,7 @@ public static function isTrue()
/**
* Returns a PHPUnit_Framework_Constraint_Callback matcher object.
*
* @param callable $callback
* @return PHPUnit_Framework_Constraint_Callback
*/
public static function callback($callback)
Expand Down
5 changes: 3 additions & 2 deletions PHPUnit/Framework/Assert/Functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1699,11 +1699,12 @@ function isTrue()
/**
* Returns a PHPUnit_Framework_Constraint_Callback matcher object.
*
* @param callable $callback
* @return PHPUnit_Framework_Constraint_Callback
*/
function callback()
function callback($callback)
{
return PHPUnit_Framework_Assert::callback();
return PHPUnit_Framework_Assert::callback($callback);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion PHPUnit/Framework/Constraint/Callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class PHPUnit_Framework_Constraint_Callback extends PHPUnit_Framework_Constraint
private $callback;

/**
* @param callable $value
* @param callable $callback
* @throws InvalidArgumentException
*/
public function __construct($callback)
Expand Down
6 changes: 3 additions & 3 deletions PHPUnit/Framework/Constraint/JsonMatches.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ public function __construct($value)
protected function matches($other)
{
$decodedOther = json_decode($other);
if (!is_object($decodedOther)) {
if (json_last_error()) {
$this->failure_reason = $this->getJsonError();
return FALSE;
}

$decodedValue = json_decode($this->value);
if (!is_object($decodedValue)) {
if (json_last_error()) {
$this->failure_reason = $this->getJsonError();
return FALSE;
}
Expand Down Expand Up @@ -123,4 +123,4 @@ public function toString()
$this->value
);
}
}
}

0 comments on commit ff5fa87

Please sign in to comment.