public function testFailureIsEqual2() { $constraint = new PHPUnit_Framework_Constraint_IsEqual(1); try { $constraint->fail(0, 'custom message'); } catch (PHPUnit_Framework_ExpectationFailedException $e) { $this->assertEquals("custom message\nFailed asserting that <integer:0> matches expected value <integer:1>.\n", PHPUnit_Framework_TestFailure::exceptionToString($e)); return; } $this->fail(); }
public function testConstraintIsEqual2() { $constraint = new PHPUnit_Framework_Constraint_IsEqual(1); try { $constraint->fail(0, 'custom message'); } catch (PHPUnit_Framework_ExpectationFailedException $e) { $this->assertEquals("custom message\nFailed asserting that <integer:0> is equal to <integer:1>.", $e->getDescription()); return; } $this->fail(); }
public function testConstraintIsEqual() { $constraint = new PHPUnit_Framework_Constraint_IsEqual(1); $this->assertFalse($constraint->evaluate(0)); $this->assertTrue($constraint->evaluate(1)); $this->assertEquals('is equal to <integer:1>', $constraint->toString()); try { $constraint->fail(0, ''); } catch (PHPUnit_Framework_ExpectationFailedException $e) { $this->assertEquals("Failed asserting that <integer:0> is equal to <integer:1>.", $e->getDescription()); return; } $this->fail(); }