isJson() public static method

Returns a PHPUnit_Framework_Constraint_IsJson matcher object.
public static isJson ( ) : PHPUnit_Framework_Constraint_IsJson
return PHPUnit_Framework_Constraint_IsJson
Esempio n. 1
0
 public function toBeJson()
 {
     if ($this->negate) {
         a::assertThat($this->actual, a::logicalAnd(a::isType('string'), a::logicalNot(a::isJson())));
     } else {
         a::assertJson($this->actual);
     }
 }
function bodyMatchesJson($constraints)
{
    return Assert::logicalAnd(hasContentType('application/json'), bodyMatches(Assert::logicalAnd(Assert::isJson(), new JsonValueMatchesMany($constraints))));
}
 public static function bodyMatchesJson(array $constraints)
 {
     return Assert::logicalAnd(self::hasHeader('content-type', Assert::matchesRegularExpression(',^application/json(;.+)?$,')), self::bodyMatches(Assert::logicalAnd(Assert::isJson(), new JsonValueMatchesMany($constraints))));
 }