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

Merge pull request #6879 from marc1706/ticket/17555-master

[ticket/17555] Only run unit tests on windows runners -- master version
This commit is contained in:
Marc Alexander
2025-10-06 18:13:14 +02:00
committed by GitHub
3 changed files with 39 additions and 18 deletions

View File

@@ -504,11 +504,10 @@ jobs:
runs-on: windows-2025 runs-on: windows-2025
strategy: strategy:
matrix: matrix:
type: ['unit', 'functional'] php: ['8.1', '8.2', '8.3', '8.4']
php: ['8.4']
db: ['postgres'] db: ['postgres']
name: Windows - ${{ matrix.type }} - PHP ${{ matrix.php }} - ${{ matrix.db }} name: Windows - PHP ${{ matrix.php }} - ${{ matrix.db }}
steps: steps:
- name: Prepare git for Windows - name: Prepare git for Windows
@@ -640,16 +639,8 @@ jobs:
run: npm ci run: npm ci
- name: Run unit tests - name: Run unit tests
if: ${{ matrix.type == 'unit' }} uses: nick-fields/retry@v3
run: | with:
phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --display-all-issues --stop-on-error --exclude-group functional,slow timeout_minutes: 15
- name: Run functional tests max_attempts: 3
if: ${{ matrix.type == 'functional' }} command: phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --display-all-issues --stop-on-error --exclude-group functional,slow
timeout-minutes: 45
env:
PHPBB_FUNCTIONAL_TIMEOUT: 30
SYMFONY_DEPRECATIONS_HELPER: disabled
PHPBB_TEST_REDIS_HOST: ''
PHPBB_TEST_MEMCACHED_HOST: ''
run: |
phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --display-all-issues --stop-on-error --group functional

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);