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


PHP PHPUnit_Framework_Assert::logicalNot方法代码示例

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


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

示例1: __construct

 public function __construct($name, $constraint = null)
 {
     parent::__construct();
     if ($constraint === null) {
         $constraint = Assert::logicalNot(Assert::isEmpty());
     } elseif (!$constraint instanceof Constraint) {
         $constraint = Assert::equalTo($constraint);
     }
     $this->name = strtolower($name);
     $this->constraint = $constraint;
 }
开发者ID:martin-helmich,项目名称:phpunit-psr7-assert,代码行数:11,代码来源:HasHeaderConstraint.php

示例2: logicalNot

/**
 * Returns a PHPUnit_Framework_Constraint_Not matcher object.
 *
 * @param  PHPUnit_Framework_Constraint $constraint
 * @return PHPUnit_Framework_Constraint_Not
 * @since  Method available since Release 3.0.0
 */
function logicalNot(PHPUnit_Framework_Constraint $constraint)
{
    return PHPUnit_Framework_Assert::logicalNot($constraint);
}
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:11,代码来源:Functions.php

示例3: testAttributeNotEqualTo2

 /**
  * @covers PHPUnit_Framework_Assert::attributeEqualTo
  * @covers PHPUnit_Framework_Assert::logicalNot
  * @covers PHPUnit_Framework_Constraint_Attribute
  * @covers PHPUnit_Framework_Constraint_Not
  */
 public function testAttributeNotEqualTo2()
 {
     $object = new ClassWithNonPublicAttributes();
     $constraint = PHPUnit_Framework_Assert::logicalNot(PHPUnit_Framework_Assert::attributeEqualTo('foo', 1));
     try {
         $constraint->fail($object, 'custom message', TRUE);
     } catch (PHPUnit_Framework_ExpectationFailedException $e) {
         $this->assertEquals("custom message\nFailed asserting that attribute \"foo\" is not equal to <integer:1>.", $e->getDescription());
         return;
     }
     $this->fail();
 }
开发者ID:kdambekalns,项目名称:framework-benchs,代码行数:18,代码来源:ConstraintTest.php

示例4: testConstraintNotSameSizeFailing

    /**
     * @covers PHPUnit_Framework_Constraint_SameSize
     * @covers PHPUnit_Framework_Constraint_Not
     * @covers PHPUnit_Framework_Assert::logicalNot
     * @covers PHPUnit_Framework_TestFailure::exceptionToString
     */
    public function testConstraintNotSameSizeFailing()
    {
        $constraint = PHPUnit_Framework_Assert::logicalNot(new PHPUnit_Framework_Constraint_SameSize(array(1, 2)));
        try {
            $constraint->evaluate(array(3, 4));
        } catch (PHPUnit_Framework_ExpectationFailedException $e) {
            $this->assertEquals(<<<EOF
Failed asserting that actual size 2 does not match expected size 2.

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

示例5: toBeJson

 public function toBeJson()
 {
     if ($this->negate) {
         a::assertThat($this->actual, a::logicalAnd(a::isType('string'), a::logicalNot(a::isJson())));
     } else {
         a::assertJson($this->actual);
     }
 }
开发者ID:jasonmccreary,项目名称:expect,代码行数:8,代码来源:Expect.php

示例6: logicalNot

/**
 * Returns a PHPUnit_Framework_Constraint_Not matcher object.
 *
 * @param  PHPUnit_Framework_Constraint $constraint
 * @return PHPUnit_Framework_Constraint_Not
 * @since  Method available since Release 3.0.0
 */
function logicalNot($constraint)
{
    PHPUnit_Framework_Assert::logicalNot($constraint);
}
开发者ID:strager,项目名称:phpunit,代码行数:11,代码来源:Functions.php

示例7: shouldNotContain

 public function shouldNotContain($value)
 {
     Assert::assertThat($this->it, Assert::logicalNot(Assert::contains($value)));
 }
开发者ID:pago,项目名称:pantr,代码行数:4,代码来源:Matcher.php


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