You are here

public function Framework_ConstraintTest::testConstraintArrayContainsCheckForObjectIdentity in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/tests/Framework/ConstraintTest.php \Framework_ConstraintTest::testConstraintArrayContainsCheckForObjectIdentity()

@covers PHPUnit_Framework_Constraint_TraversableContains

File

vendor/phpunit/phpunit/tests/Framework/ConstraintTest.php, line 2872

Class

Framework_ConstraintTest
@since Class available since Release 3.0.0

Code

public function testConstraintArrayContainsCheckForObjectIdentity() {

  // Check for primitive type.
  $constraint = new PHPUnit_Framework_Constraint_TraversableContains('foo', true, true);
  $this
    ->assertFalse($constraint
    ->evaluate(array(
    0,
  ), '', true));
  $this
    ->assertFalse($constraint
    ->evaluate(array(
    true,
  ), '', true));

  // Default case.
  $constraint = new PHPUnit_Framework_Constraint_TraversableContains('foo');
  $this
    ->assertTrue($constraint
    ->evaluate(array(
    0,
  ), '', true));
  $this
    ->assertTrue($constraint
    ->evaluate(array(
    true,
  ), '', true));
}