Пример #1
0
 /**
  * Ensures that setFiles() returns expected value
  *
  * @return void
  */
 public function testSetFiles()
 {
     $files = array('test' => array('name' => 'test1', 'type' => 'text', 'size' => 200, 'tmp_name' => 'tmp_test1', 'error' => 0), 'test2' => array('name' => 'test2', 'type' => 'text2', 'size' => 202, 'tmp_name' => 'tmp_test2', 'error' => 1));
     $_FILES = array('test' => array('name' => 'test3', 'type' => 'text3', 'size' => 203, 'tmp_name' => 'tmp_test3', 'error' => 2));
     $validator = new Zend_Validate_File_Upload();
     $validator->setFiles(array());
     $this->assertEquals($_FILES, $validator->getFiles());
     $validator->setFiles();
     $this->assertEquals($_FILES, $validator->getFiles());
     $validator->setFiles($files);
     $this->assertEquals($files, $validator->getFiles());
 }
 /**
  * @group ZF-10738
  */
 public function testGetFilesReturnsEmptyArrayAfterSetFilesIsCalledWithNull()
 {
     $validator = new Zend_Validate_File_Upload();
     $validator->setFiles(NULL);
     $this->assertEquals(array(), $validator->getFiles());
 }