Beispiel #1
0
 /**
  * @ZF-8111
  */
 public function testErrorMessages()
 {
     $files = array('name' => 'picture.jpg', 'type' => 'image/jpeg', 'size' => 200, 'tmp_name' => __DIR__ . '/_files/picture.jpg', 'error' => 0);
     $validator = new File\IsCompressed('test/notype');
     $validator->enableHeaderCheck();
     $this->assertFalse($validator->isValid(__DIR__ . '/_files/picture.jpg', $files));
     $error = $validator->getMessages();
     $this->assertTrue(array_key_exists('fileIsCompressedFalseType', $error));
 }
Beispiel #2
0
 /**
  * @group ZF-11258
  */
 public function testZF11258()
 {
     $validator = new File\IsCompressed();
     $this->assertFalse($validator->isValid(__DIR__ . '/_files/nofile.mo'));
     $this->assertTrue(array_key_exists('fileIsCompressedNotReadable', $validator->getMessages()));
     $this->assertContains("'nofile.mo'", current($validator->getMessages()));
 }