/** * @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)); }
/** * @param \DateTime $date Date. * @param bool $exists Exists or not. */ public function __construct(\DateTime $date, $exists) { $this->date = $date; parent::__construct($exists); }