1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-01 21:27:55 +02:00

[ticket/17176] Use NativeHttpClient on windows builds

PHPBB3-17176
This commit is contained in:
Marc Alexander 2023-09-05 20:43:43 +02:00
parent dc4d79f3a8
commit 5d6218dcba
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995
2 changed files with 6 additions and 3 deletions

View File

@ -583,7 +583,7 @@ jobs:
if: ${{ matrix.type == 'unit' }}
run: |
phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --verbose --stop-on-error --exclude-group functional
- name: Run unit tests
- name: Run functional tests
if: ${{ matrix.type == 'functional' }}
run: |
phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --verbose --stop-on-error --group functional

View File

@ -13,12 +13,14 @@
use Symfony\Component\BrowserKit\CookieJar;
use Symfony\Component\BrowserKit\HttpBrowser;
use Symfony\Component\HttpClient\HttpClient;
use Symfony\Component\HttpClient\NativeHttpClient;
use Symfony\Contracts\HttpClient\HttpClientInterface;
require_once __DIR__ . '/mock/phpbb_mock_null_installer_task.php';
class phpbb_functional_test_case extends phpbb_test_case
{
/** @var HttpClient */
/** @var HttpClientInterface */
protected static $http_client;
/** @var HttpBrowser */
@ -94,7 +96,8 @@ class phpbb_functional_test_case extends phpbb_test_case
$this->bootstrap();
self::$cookieJar = new CookieJar;
self::$http_client = HttpClient::create();
// Force native client on windows platform
self::$http_client = strtolower(substr(PHP_OS, 0, 3)) === 'win' ? new NativeHttpClient() : HttpClient::create();
self::$client = new HttpBrowser(self::$http_client, null, self::$cookieJar);
// Clear the language array so that things