PHPUnit_Framework_Assert::assertThat PHP Method

assertThat() public static method

Evaluates a PHPUnit_Framework_Constraint matcher object.
public static assertThat ( mixed $value, PHPUnit_Framework_Constraint $constraint, string $message = '' )
$value mixed
$constraint PHPUnit_Framework_Constraint
$message string
    public static function assertThat($value, PHPUnit_Framework_Constraint $constraint, $message = '')
    {
        self::$count += count($constraint);
        $constraint->evaluate($value, $message);
    }

Usage Example

 /**
  * Asserts response headers match with the media types defined.
  *
  * @param string[] $headers
  * @param SchemaManager $schemaManager
  * @param string $path percent-encoded path used on the request.
  * @param string $httpMethod
  * @param int $httpCode
  * @param string $message
  */
 public function assertResponseHeadersMatch(array $headers, SchemaManager $schemaManager, $path, $httpMethod, $httpCode, $message = '')
 {
     if (!$schemaManager->findPathInTemplates($path, $template, $params)) {
         throw new \RuntimeException('Request URI does not match with any swagger path definition');
     }
     $constraint = new ResponseHeadersConstraint($schemaManager, $template, $httpMethod, $httpCode);
     Assert::assertThat($headers, $constraint, $message);
 }
All Usage Examples Of PHPUnit_Framework_Assert::assertThat
PHPUnit_Framework_Assert