diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 018b489193..39edb8ae0f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -504,11 +504,10 @@ jobs: runs-on: windows-2025 strategy: matrix: - type: ['unit', 'functional'] - php: ['8.4'] + php: ['8.1', '8.2', '8.3', '8.4'] db: ['postgres'] - name: Windows - ${{ matrix.type }} - PHP ${{ matrix.php }} - ${{ matrix.db }} + name: Windows - PHP ${{ matrix.php }} - ${{ matrix.db }} steps: - name: Prepare git for Windows @@ -640,16 +639,8 @@ jobs: run: npm ci - name: Run unit tests - if: ${{ matrix.type == 'unit' }} - run: | - phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --display-all-issues --stop-on-error --exclude-group functional,slow - - name: Run functional tests - if: ${{ matrix.type == 'functional' }} - 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 + uses: nick-fields/retry@v3 + 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 diff --git a/tests/avatar/manager_test.php b/tests/avatar/manager_test.php index 347f1597a4..caf2dc82e5 100644 --- a/tests/avatar/manager_test.php +++ b/tests/avatar/manager_test.php @@ -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; diff --git a/tests/console/update/check_test.php b/tests/console/update/check_test.php index 5eb7c1ea58..450ec93338 100644 --- a/tests/console/update/check_test.php +++ b/tests/console/update/check_test.php @@ -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);