本文整理汇总了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;
}
示例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);
}
示例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();
}
示例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();
}
示例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);
}
}
示例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);
}
示例7: shouldNotContain
public function shouldNotContain($value)
{
Assert::assertThat($this->it, Assert::logicalNot(Assert::contains($value)));
}