当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPUnit_Framework_TestCase::assertThat方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:arcavias,项目名称:arcavias-core,代码行数:15,代码来源:Testcase.php

示例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);
 }
开发者ID:wickedOne,项目名称:FOSHttpCache,代码行数:10,代码来源:CacheAssertions.php

示例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));
 }
开发者ID:helios-ag,项目名称:SymfonyConfigTest,代码行数:13,代码来源:ConfigurationTestCaseTrait.php

示例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));
 }
开发者ID:Nycto,项目名称:Round-Eights,代码行数:12,代码来源:Iterator.php

示例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));
 }
开发者ID:Nycto,项目名称:Round-Eights,代码行数:9,代码来源:SQL.php

示例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);
 }
开发者ID:naturalweb,项目名称:nwlaravel,代码行数:10,代码来源:WebAssertTrait.php

示例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);
 }
开发者ID:adam-paterson,项目名称:orocommerce,代码行数:10,代码来源:EntityTestCaseTrait.php

示例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);
 }
开发者ID:bartfeenstra,项目名称:doobie,代码行数:12,代码来源:AssertTrait.php

示例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);
 }
开发者ID:jakzal,项目名称:php-matcher,代码行数:9,代码来源:PHPMatcherAssertions.php

示例10: assertBinaryEqual

 protected function assertBinaryEqual($expected, $actual, $message = '')
 {
     $constraint = new IsBinaryEqual($expected);
     PHPUnit_Framework_TestCase::assertThat($actual, $constraint, $message);
 }
开发者ID:bramp,项目名称:protoc-gen-php,代码行数:5,代码来源:phpunit_base.php

示例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);
 }
开发者ID:zoek1,项目名称:php-testing-tools,代码行数:9,代码来源:ProvidesMoneyConstraints.php

示例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;
 }
开发者ID:stof,项目名称:php-sdk,代码行数:18,代码来源:Client.php


注:本文中的PHPUnit_Framework_TestCase::assertThat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。