mirror of
https://github.com/phpbb/phpbb.git
synced 2025-10-12 23:44:32 +02:00
Merge branch 'ticket/17555' into ticket/17555-master
This commit is contained in:
@@ -53,7 +53,11 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case
|
||||
$phpEx
|
||||
);
|
||||
|
||||
$imagesize = new \FastImageSize\FastImageSize();
|
||||
$imagesize = $this->getMockBuilder('\FastImageSize\FastImageSize')
|
||||
->onlyMethods(['getImageSize'])
|
||||
->getMock();
|
||||
$imagesize->method('getImageSize')
|
||||
->willReturn(['width' => 80, 'height' => 80, 'mime' => 'image/jpeg']);
|
||||
|
||||
$dispatcher = new phpbb_mock_event_dispatcher();
|
||||
$phpbb_dispatcher = $dispatcher;
|
||||
|
@@ -89,7 +89,33 @@ class phpbb_console_command_check_test extends phpbb_test_case
|
||||
->getMock();
|
||||
|
||||
$config = new \phpbb\config\config(array('version' => $current_version));
|
||||
$this->version_helper = new \phpbb\version_helper($cache, $config, new \phpbb\file_downloader());
|
||||
$this->version_helper = $this->getMockBuilder('\phpbb\version_helper')
|
||||
->setConstructorArgs([$cache, $config, new \phpbb\file_downloader()])
|
||||
->onlyMethods(['get_suggested_updates'])
|
||||
->getMock();
|
||||
$this->version_helper->method('get_suggested_updates')
|
||||
->willReturnCallback(function($force_update = false, $force_cache = false) use ($config)
|
||||
{
|
||||
if ($config['version'] === '100000')
|
||||
{
|
||||
return [];
|
||||
}
|
||||
else if ($config['version'] === '0')
|
||||
{
|
||||
return [
|
||||
[
|
||||
'current' => '100000',
|
||||
'announcement' => 'https://www.phpbb.com/downloads/',
|
||||
'eol' => null,
|
||||
'security' => false,
|
||||
],
|
||||
];
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new \phpbb\exception\runtime_exception('VERSIONCHECK_FAIL');
|
||||
}
|
||||
});
|
||||
|
||||
$container = new phpbb_mock_container_builder;
|
||||
$container->set('version_helper', $this->version_helper);
|
||||
|
Reference in New Issue
Block a user