public function testFailureFileExists2() { $constraint = new PHPUnit_Framework_Constraint_FileExists(); try { $constraint->fail('foo', 'custom message'); } catch (PHPUnit_Framework_ExpectationFailedException $e) { $this->assertEquals("custom message\nFailed asserting that file \"foo\" exists.\n", PHPUnit_Framework_TestFailure::exceptionToString($e)); return; } $this->fail(); }
public function testConstraintFileExists2() { $constraint = new PHPUnit_Framework_Constraint_FileExists(); try { $constraint->fail('foo', 'custom message'); } catch (PHPUnit_Framework_ExpectationFailedException $e) { $this->assertEquals("custom message\nFailed asserting that file \"foo\" exists.", $e->getDescription()); return; } $this->fail(); }
public function testConstraintFileExists() { $constraint = new PHPUnit_Framework_Constraint_FileExists(); $this->assertFalse($constraint->evaluate('foo')); $this->assertEquals('file exists', $constraint->toString()); try { $constraint->fail('foo', ''); } catch (PHPUnit_Framework_ExpectationFailedException $e) { $this->assertEquals('Failed asserting that file "foo" exists.', $e->getDescription()); return; } $this->fail(); }