Пример #1
0
 /**
  * @group ZF-11258
  */
 public function testZF11258()
 {
     $validator = new File\NotExists();
     $this->assertFalse($validator->isValid(__DIR__ . '/_files/testsize.mo'));
     $this->assertTrue(array_key_exists('fileNotExistsDoesExist', $validator->getMessages()));
     $this->assertContains("File exists", current($validator->getMessages()));
 }
Пример #2
0
 /**
  * Ensures that addDirectory() returns expected value
  *
  * @return void
  */
 public function testAddDirectory()
 {
     $validator = new File\NotExists('temp');
     $validator->addDirectory('gif');
     $this->assertEquals('temp,gif', $validator->getDirectory());
     $this->assertEquals(array('temp', 'gif'), $validator->getDirectory(true));
     $validator->addDirectory('jpg, to');
     $this->assertEquals('temp,gif,jpg,to', $validator->getDirectory());
     $this->assertEquals(array('temp', 'gif', 'jpg', 'to'), $validator->getDirectory(true));
     $validator->addDirectory(array('zip', 'ti'));
     $this->assertEquals('temp,gif,jpg,to,zip,ti', $validator->getDirectory());
     $this->assertEquals(array('temp', 'gif', 'jpg', 'to', 'zip', 'ti'), $validator->getDirectory(true));
     $validator->addDirectory('');
     $this->assertEquals('temp,gif,jpg,to,zip,ti', $validator->getDirectory());
     $this->assertEquals(array('temp', 'gif', 'jpg', 'to', 'zip', 'ti'), $validator->getDirectory(true));
 }