assertTrue($rule->validate($input)); } /** * @covers Respect\Validation\Rules\Exists::validate */ public function testNonExistentFileShouldReturnFalse() { $GLOBALS['file_exists'] = false; $rule = new Exists(); $input = '/path/of/a/non-existent/file'; $this->assertFalse($rule->validate($input)); } /** * @covers Respect\Validation\Rules\Exists::validate */ public function testShouldValidateObjects() { $GLOBALS['file_exists'] = true; $rule = new Exists(); $object = new \SplFileInfo('/path/of/an/existent/file'); $this->assertTrue($rule->validate($object)); } }