public function testFailureGreaterThan2() { $constraint = new PHPUnit_Framework_Constraint_GreaterThan(1); try { $constraint->fail(0, 'custom message'); } catch (PHPUnit_Framework_ExpectationFailedException $e) { $this->assertEquals("custom message\nFailed asserting that <integer:0> is greater than <integer:1>.\n", PHPUnit_Framework_TestFailure::exceptionToString($e)); return; } $this->fail(); }
public function testConstraintGreaterThan2() { $constraint = new PHPUnit_Framework_Constraint_GreaterThan(1); try { $constraint->fail(0, 'custom message'); } catch (PHPUnit_Framework_ExpectationFailedException $e) { $this->assertEquals("custom message\nFailed asserting that <integer:0> is greater than <integer:1>.", $e->getDescription()); return; } $this->fail(); }
public function testConstraintGreaterThan() { $constraint = new PHPUnit_Framework_Constraint_GreaterThan(1); $this->assertFalse($constraint->evaluate(0)); $this->assertTrue($constraint->evaluate(2)); $this->assertEquals('is greater than <integer:1>', $constraint->toString()); try { $constraint->fail(0, ''); } catch (PHPUnit_Framework_ExpectationFailedException $e) { $this->assertEquals("Failed asserting that <integer:0> is greater than <integer:1>.", $e->getDescription()); return; } $this->fail(); }