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()); }
/** * @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())); }