mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-12 06:18:52 +00:00
[ticket/14428] Fix files types remote tests
PHPBB3-14428
This commit is contained in:
parent
e28a5da457
commit
10bf5c1533
1 changed files with 6 additions and 6 deletions
|
@ -85,8 +85,8 @@ class phpbb_files_types_remote_test extends phpbb_test_case
|
||||||
array('500k', 'http://example.com/foo/bar.png'),
|
array('500k', 'http://example.com/foo/bar.png'),
|
||||||
array('500M', 'http://example.com/foo/bar.png'),
|
array('500M', 'http://example.com/foo/bar.png'),
|
||||||
array('500m', 'http://example.com/foo/bar.png'),
|
array('500m', 'http://example.com/foo/bar.png'),
|
||||||
array('500k', 'http://google.com/.png', 'DISALLOWED_CONTENT'),
|
array('500k', 'http://google.com/?.png', array('DISALLOWED_EXTENSION', 'DISALLOWED_CONTENT')),
|
||||||
array('1', 'http://google.com/.png', 'WRONG_FILESIZE'),
|
array('1', 'http://google.com/?.png', array('WRONG_FILESIZE')),
|
||||||
array('500g', 'http://example.com/foo/bar.png'),
|
array('500g', 'http://example.com/foo/bar.png'),
|
||||||
array('foobar', 'http://example.com/foo/bar.png'),
|
array('foobar', 'http://example.com/foo/bar.png'),
|
||||||
array('-5k', 'http://example.com/foo/bar.png'),
|
array('-5k', 'http://example.com/foo/bar.png'),
|
||||||
|
@ -96,7 +96,7 @@ class phpbb_files_types_remote_test extends phpbb_test_case
|
||||||
/**
|
/**
|
||||||
* @dataProvider data_get_max_file_size
|
* @dataProvider data_get_max_file_size
|
||||||
*/
|
*/
|
||||||
public function test_get_max_file_size($max_file_size, $link, $expected = 'URL_NOT_FOUND')
|
public function test_get_max_file_size($max_file_size, $link, $expected = array('URL_NOT_FOUND'))
|
||||||
{
|
{
|
||||||
$php_ini = $this->getMock('\bantu\IniGetWrapper\IniGetWrapper', array('getString'));
|
$php_ini = $this->getMock('\bantu\IniGetWrapper\IniGetWrapper', array('getString'));
|
||||||
$php_ini->expects($this->any())
|
$php_ini->expects($this->any())
|
||||||
|
@ -109,7 +109,7 @@ class phpbb_files_types_remote_test extends phpbb_test_case
|
||||||
|
|
||||||
$file = $type_remote->upload($link);
|
$file = $type_remote->upload($link);
|
||||||
|
|
||||||
$this->assertSame(array($expected), $file->error);
|
$this->assertSame($expected, $file->error);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_upload_timeout()
|
public function test_upload_timeout()
|
||||||
|
@ -120,7 +120,7 @@ class phpbb_files_types_remote_test extends phpbb_test_case
|
||||||
$type_remote->set_upload($upload);
|
$type_remote->set_upload($upload);
|
||||||
$upload->upload_timeout = -5;
|
$upload->upload_timeout = -5;
|
||||||
|
|
||||||
$file = $type_remote->upload('http://google.com/.png');
|
$file = $type_remote->upload('http://google.com/?.png');
|
||||||
|
|
||||||
$this->assertSame(array('REMOTE_UPLOAD_TIMEOUT'), $file->error);
|
$this->assertSame(array('REMOTE_UPLOAD_TIMEOUT'), $file->error);
|
||||||
}
|
}
|
||||||
|
@ -133,7 +133,7 @@ class phpbb_files_types_remote_test extends phpbb_test_case
|
||||||
$type_remote->set_upload($upload);
|
$type_remote->set_upload($upload);
|
||||||
$type_remote::$tempnam_path = $this->phpbb_root_path . 'cache/wrong/path';
|
$type_remote::$tempnam_path = $this->phpbb_root_path . 'cache/wrong/path';
|
||||||
|
|
||||||
$file = $type_remote->upload('http://google.com/.png');
|
$file = $type_remote->upload('http://google.com/?.png');
|
||||||
|
|
||||||
$this->assertSame(array('NOT_UPLOADED'), $file->error);
|
$this->assertSame(array('NOT_UPLOADED'), $file->error);
|
||||||
$type_remote::$tempnam_path = '';
|
$type_remote::$tempnam_path = '';
|
||||||
|
|
Loading…
Add table
Reference in a new issue