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:
parent
dc4d79f3a8
commit
5d6218dcba
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user