[ticket/13904] Fix filespec tests

PHPBB3-13904
This commit is contained in:
Marc Alexander 2015-06-02 00:29:03 +02:00
parent 57de896286
commit 2915647a54
2 changed files with 4 additions and 3 deletions

View file

@ -426,7 +426,7 @@ class filespec
$this->height = $this->image_info['height']; $this->height = $this->image_info['height'];
// Check image type // Check image type
$types = \fileupload::image_types(); $types = upload::image_types();
if (!isset($types[$this->image_info['type']]) || !in_array($this->extension, $types[$this->image_info['type']])) if (!isset($types[$this->image_info['type']]) || !in_array($this->extension, $types[$this->image_info['type']]))
{ {

View file

@ -91,7 +91,8 @@ class phpbb_filespec_test extends phpbb_test_case
'error' => '', 'error' => '',
); );
return new filespec(array_merge($upload_ary, $override), null, $this->filesystem, $this->mimetype_guesser); $filespec = new \phpbb\files\filespec($this->filesystem, $this->mimetype_guesser);
return $filespec->set_upload_ary(array_merge($upload_ary, $override));
} }
protected function tearDown() protected function tearDown()
@ -226,7 +227,7 @@ class phpbb_filespec_test extends phpbb_test_case
*/ */
public function test_get_extension($filename, $expected) public function test_get_extension($filename, $expected)
{ {
$this->assertEquals($expected, filespec::get_extension($filename)); $this->assertEquals($expected, \phpbb\files\filespec::get_extension($filename));
} }
public function is_image_variables() public function is_image_variables()