/** * @dataProvider data_upload_form */ public function test_upload_form($filename, $upload_ary, $expected) { $filespec = new \phpbb\files\filespec($this->filesystem, $this->language, $this->php_ini, new \FastImageSize\FastImageSize(), $this->phpbb_root_path, new \phpbb\mimetype\guesser(array('mimetype.extension_guesser' => new \phpbb\mimetype\extension_guesser()))); $filespec_local = new ReflectionProperty($filespec, 'local'); $filespec_local->setAccessible(true); $filespec_local->setValue($filespec, true); $this->container->set('files.filespec', $filespec); $this->factory = new \phpbb\files\factory($this->container); $type_local = new \phpbb\files\types\local($this->factory, $this->language, $this->php_ini, $this->request); $upload = new \phpbb\files\upload($this->filesystem, $this->factory, $this->language, $this->php_ini, $this->request, $this->phpbb_root_path); $upload->set_allowed_extensions(array('png')); $type_local->set_upload($upload); $file = $type_local->upload($filename, $upload_ary); $this->assertSame($expected, $file->error); $this->assertInstanceOf('\\phpbb\\files\\filespec', $file); }