示例#1
0
 public function testEmptyFileShouldReturnFalseAndDisplayNotFoundMessage()
 {
     $validator = new File\WordCount();
     $this->assertFalse($validator->isValid(''));
     $this->assertArrayHasKey(File\WordCount::NOT_FOUND, $validator->getMessages());
     $filesArray = array('name' => '', 'size' => 0, 'tmp_name' => '', 'error' => UPLOAD_ERR_NO_FILE, 'type' => '');
     $this->assertFalse($validator->isValid($filesArray));
     $this->assertArrayHasKey(File\WordCount::NOT_FOUND, $validator->getMessages());
 }
示例#2
0
 /**
  * @group ZF-11258
  */
 public function testZF11258()
 {
     $validator = new File\WordCount(array('min' => 1, 'max' => 10000));
     $this->assertFalse($validator->isValid(__DIR__ . '/_files/nofile.mo'));
     $this->assertTrue(array_key_exists('fileWordCountNotFound', $validator->getMessages()));
     $this->assertContains("'nofile.mo'", current($validator->getMessages()));
 }