本文整理汇总了PHP中PHPUnit_Framework_TestCase::assertThat方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_TestCase::assertThat方法的具体用法?PHP PHPUnit_Framework_TestCase::assertThat怎么用?PHP PHPUnit_Framework_TestCase::assertThat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_TestCase
的用法示例。
在下文中一共展示了PHPUnit_Framework_TestCase::assertThat方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: assertEmpty
/**
* Calls assertEmpty() or assertThat() depending on the PHPUnit version.
* Available from PHPUnit >= 3.5
*
* @param mixed $actual Actual value
* @param string $message Message to print if assertion is wrong
*/
public static function assertEmpty($actual, $message = '')
{
if (self::_checkMethod('assertEmpty')) {
parent::assertEmpty($actual, $message);
} else {
parent::assertThat($actual, parent::isEmpty(), $message);
}
}
示例2: assertHit
/**
* Assert a cache hit.
*
* @param ResponseInterface $response
* @param string $message Test failure message (optional)
*/
public function assertHit(ResponseInterface $response, $message = null)
{
\PHPUnit_Framework_TestCase::assertThat($response, self::isCacheHit(), $message);
}
示例3: assertProcessedConfigurationEquals
/**
* Assert that the given configuration values, when processed, will equal to the given array.
*
* Optionally provide the part of the configuration that you want to test, e.g. "doctrine.orm"
*
* @param array $configurationValues
* @param array $expectedProcessedConfiguration
* @param string|null $breadcrumbPath
*/
protected function assertProcessedConfigurationEquals(array $configurationValues, array $expectedProcessedConfiguration, $breadcrumbPath = null)
{
\PHPUnit_Framework_TestCase::assertThat($expectedProcessedConfiguration, new ProcessedConfigurationEqualsConstraint($this->getConfiguration(), $configurationValues, $breadcrumbPath));
}
示例4: assertCount
/**
* Asserts that a given value contains the specified number of elements
*
* @param Integer $expected The expected value
* @param Mixed $actual The value to compare
* @return null
*/
public static function assertCount($expected, $actual)
{
\PHPUnit_Framework_TestCase::assertThat($actual, new \PHPUnit_Framework_Constraint_IsInstanceOf('\\Traversable'));
\PHPUnit_Framework_TestCase::assertThat(self::sizeOf($expected * 1.5, $actual), new \PHPUnit_Framework_Constraint_IsEqual($expected));
}
示例5: assert
/**
* Asserts that the given value produces the expected result when iterated over
*
* @return null
*/
public static function assert($expected, $actual)
{
\PHPUnit_Framework_TestCase::assertThat($actual, new self($expected));
}
示例6: assertView
/**
* Assert that the response view has name
*
* @param string $name
* @param string $message
*/
public function assertView($name, $message = '')
{
PHPUnit::assertThat($name, new ConstraintView($this->response), $message);
}
示例7: assertPropertyGetterReturnsSetValue
/**
* @param object $instance
* @param string $propertyName
* @param mixed $testValue
* @param string $message
*/
public static function assertPropertyGetterReturnsSetValue($instance, $propertyName, $testValue, $message = '')
{
\PHPUnit_Framework_TestCase::assertThat($instance, self::propertyGetterReturnsSetValue($propertyName, $testValue), $message);
}
示例8: assertDoobieMarkers
/**
* Asserts that no Doobie markers have expired.
*
* @param \BartFeenstra\Doobie\FileFinder\FileFinderInterface[] $file_finders
* @param \BartFeenstra\Doobie\Parser\ParserInterface[] $parsers
* @param \BartFeenstra\Doobie\Constraint\ConstraintEvaluatorInterface[] $constraint_evaluators
*/
public function assertDoobieMarkers(array $file_finders, array $parsers, array $constraint_evaluators)
{
$constraint = new DoobieMarkerAssert($file_finders, $parsers, $constraint_evaluators);
\PHPUnit_Framework_TestCase::assertThat(NULL, $constraint);
}
示例9: assertMatchesPattern
/**
* @param string $pattern
* @param mixed $value
* @param string $message
*/
protected function assertMatchesPattern($pattern, $value, $message = '')
{
\PHPUnit_Framework_TestCase::assertThat($value, self::matchesPattern($pattern), $message);
}
示例10: assertBinaryEqual
protected function assertBinaryEqual($expected, $actual, $message = '')
{
$constraint = new IsBinaryEqual($expected);
PHPUnit_Framework_TestCase::assertThat($actual, $constraint, $message);
}
示例11: assertBalanceIsGreaterThan
/**
* @param integer $lowerLimitAmount
* @param Member $forMember
* @param string $message
*/
public static function assertBalanceIsGreaterThan($lowerLimitAmount, Member $forMember, $message = '')
{
TestCase::assertThat($forMember->information()->accountBalance(), self::isBalanceAmountGreaterThan($lowerLimitAmount), $message);
}
示例12: assertPhpUnit
/**
* Profiles the callback and test the result against the given configuration.
*/
public function assertPhpUnit(\PHPUnit_Framework_TestCase $testCase, Profile\Configuration $config, $callback)
{
if (!$config->hasMetadata('skip_timeline')) {
$config->setMetadata('skip_timeline', 'true');
}
try {
$probe = $this->createProbe($config);
$callback();
$profile = $this->endProbe($probe);
$testCase->assertThat($profile, new BlackfireConstraint());
} catch (Exception\ExceptionInterface $e) {
$testCase->markTestSkipped($e->getMessage());
}
return $profile;
}