1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-10-12 07:24:31 +02:00

Merge branch 'ticket/17555' into ticket/17555-master

This commit is contained in:
Marc Alexander
2025-10-06 17:32:01 +02:00
3 changed files with 37 additions and 4 deletions

View File

@@ -639,5 +639,8 @@ jobs:
run: npm ci run: npm ci
- name: Run unit tests - name: Run unit tests
run: | uses: nick-fields/retry@v3
phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --display-all-issues --stop-on-error --exclude-group functional,slow with:
timeout_minutes: 15
max_attempts: 3
command: phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --display-all-issues --stop-on-error --exclude-group functional,slow

View File

@@ -53,7 +53,11 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case
$phpEx $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(); $dispatcher = new phpbb_mock_event_dispatcher();
$phpbb_dispatcher = $dispatcher; $phpbb_dispatcher = $dispatcher;

View File

@@ -89,7 +89,33 @@ class phpbb_console_command_check_test extends phpbb_test_case
->getMock(); ->getMock();
$config = new \phpbb\config\config(array('version' => $current_version)); $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 = new phpbb_mock_container_builder;
$container->set('version_helper', $this->version_helper); $container->set('version_helper', $this->version_helper);