Пример #1
0
 /**
  * @group ZF-10738
  */
 public function testGetFilesReturnsEmptyArrayAfterSetFilesIsCalledWithNull()
 {
     $validator = new File\Upload();
     $validator->setFiles(NULL);
     $this->assertEquals(array(), $validator->getFiles());
 }
Пример #2
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 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());
 }