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