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


PHP PHPUnit_Framework_Assert::greaterThanOrEqual方法代码示例

本文整理汇总了PHP中PHPUnit_Framework_Assert::greaterThanOrEqual方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_Assert::greaterThanOrEqual方法的具体用法?PHP PHPUnit_Framework_Assert::greaterThanOrEqual怎么用?PHP PHPUnit_Framework_Assert::greaterThanOrEqual使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPUnit_Framework_Assert的用法示例。


在下文中一共展示了PHPUnit_Framework_Assert::greaterThanOrEqual方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testConstraintNotGreaterThanOrEqual2

 /**
  * @covers PHPUnit_Framework_Constraint_IsEqual
  * @covers PHPUnit_Framework_Constraint_GreaterThan
  * @covers PHPUnit_Framework_Constraint_Or
  * @covers PHPUnit_Framework_Constraint_Not
  * @covers PHPUnit_Framework_Assert::greaterThanOrEqual
  * @covers PHPUnit_Framework_Assert::logicalNot
  */
 public function testConstraintNotGreaterThanOrEqual2()
 {
     $constraint = PHPUnit_Framework_Assert::logicalNot(PHPUnit_Framework_Assert::greaterThanOrEqual(1));
     try {
         $constraint->fail(1, 'custom message', TRUE);
     } catch (PHPUnit_Framework_ExpectationFailedException $e) {
         $this->assertEquals("custom message\nFailed asserting that <integer:1> not( is equal to <integer:1> or is greater than <integer:1> ).", $e->getDescription());
         return;
     }
     $this->fail();
 }
开发者ID:kdambekalns,项目名称:framework-benchs,代码行数:19,代码来源:ConstraintTest.php

示例2: greaterThanOrEqual

/**
 * Returns a PHPUnit_Framework_Constraint_Or matcher object that wraps
 * a PHPUnit_Framework_Constraint_IsEqual and a
 * PHPUnit_Framework_Constraint_GreaterThan matcher object.
 *
 * @param  mixed $value
 * @return PHPUnit_Framework_Constraint_Or
 * @since  Method available since Release 3.1.0
 */
function greaterThanOrEqual($value)
{
    return PHPUnit_Framework_Assert::greaterThanOrEqual($value);
}
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:13,代码来源:Functions.php

示例3: testConstraintNotGreaterThanOrEqual2

    /**
     * @covers PHPUnit_Framework_Constraint_IsEqual
     * @covers PHPUnit_Framework_Constraint_GreaterThan
     * @covers PHPUnit_Framework_Constraint_Or
     * @covers PHPUnit_Framework_Constraint_Not
     * @covers PHPUnit_Framework_Assert::greaterThanOrEqual
     * @covers PHPUnit_Framework_Assert::logicalNot
     * @covers PHPUnit_Framework_TestFailure::exceptionToString
     */
    public function testConstraintNotGreaterThanOrEqual2()
    {
        $constraint = PHPUnit_Framework_Assert::logicalNot(PHPUnit_Framework_Assert::greaterThanOrEqual(1));
        try {
            $constraint->evaluate(1, 'custom message');
        } catch (PHPUnit_Framework_ExpectationFailedException $e) {
            $this->assertEquals(<<<EOF
custom message
Failed asserting that not( 1 is equal to 1 or is greater than 1 ).

EOF
, PHPUnit_Framework_TestFailure::exceptionToString($e));
            return;
        }
        $this->fail();
    }
开发者ID:ProgrammingPeter,项目名称:nba-schedule-api,代码行数:25,代码来源:ConstraintTest.php

示例4: testHasHeadersCanSucceedWithConstraint

 public function testHasHeadersCanSucceedWithConstraint()
 {
     $request = new Request('GET', '/', ['x-foo' => 14, 'content-type' => 'text/plain']);
     assertThat($request, hasHeaders(['X-Foo' => Assert::greaterThanOrEqual(10), 'Content-Type' => 'text/plain']));
 }
开发者ID:martin-helmich,项目名称:phpunit-psr7-assert,代码行数:5,代码来源:FunctionalConstraintTest.php

示例5: testStatusCanBeAnyConstraintAndCanFail

 /**
  * @expectedException \PHPUnit_Framework_AssertionFailedError
  */
 public function testStatusCanBeAnyConstraintAndCanFail()
 {
     $response = new Response(234);
     $constraint = new HasStatusConstraint(Assert::greaterThanOrEqual(300));
     $constraint->evaluate($response);
 }
开发者ID:martin-helmich,项目名称:phpunit-psr7-assert,代码行数:9,代码来源:HasStatusConstraintTest.php

示例6: isServerError

 public static function isServerError()
 {
     return new HasStatusConstraint(Assert::logicalAnd(Assert::greaterThanOrEqual(500), Assert::lessThan(600)));
 }
开发者ID:martin-helmich,项目名称:phpunit-psr7-assert,代码行数:4,代码来源:Psr7Assertions.php

示例7: testHasHeaderCanFailWithConstraint

 /**
  * @expectedException \PHPUnit_Framework_AssertionFailedError
  */
 public function testHasHeaderCanFailWithConstraint()
 {
     $request = new Request('GET', '/', ['x-foo' => 4]);
     $this->assertMessageHasHeader($request, 'X-Foo', Assert::greaterThanOrEqual(10));
 }
开发者ID:martin-helmich,项目名称:phpunit-psr7-assert,代码行数:8,代码来源:ConstraintTest.php


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