mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/17176] Use NativeHttpClient on windows builds
PHPBB3-17176
This commit is contained in:
parent
dc4d79f3a8
commit
5d6218dcba
2 changed files with 6 additions and 3 deletions
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
|
@ -583,7 +583,7 @@ jobs:
|
||||||
if: ${{ matrix.type == 'unit' }}
|
if: ${{ matrix.type == 'unit' }}
|
||||||
run: |
|
run: |
|
||||||
phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --verbose --stop-on-error --exclude-group functional
|
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' }}
|
if: ${{ matrix.type == 'functional' }}
|
||||||
run: |
|
run: |
|
||||||
phpBB/vendor/bin/phpunit --configuration .github/phpunit-psql-windows-github.xml --verbose --stop-on-error --group functional
|
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\CookieJar;
|
||||||
use Symfony\Component\BrowserKit\HttpBrowser;
|
use Symfony\Component\BrowserKit\HttpBrowser;
|
||||||
use Symfony\Component\HttpClient\HttpClient;
|
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';
|
require_once __DIR__ . '/mock/phpbb_mock_null_installer_task.php';
|
||||||
|
|
||||||
class phpbb_functional_test_case extends phpbb_test_case
|
class phpbb_functional_test_case extends phpbb_test_case
|
||||||
{
|
{
|
||||||
/** @var HttpClient */
|
/** @var HttpClientInterface */
|
||||||
protected static $http_client;
|
protected static $http_client;
|
||||||
|
|
||||||
/** @var HttpBrowser */
|
/** @var HttpBrowser */
|
||||||
|
@ -94,7 +96,8 @@ class phpbb_functional_test_case extends phpbb_test_case
|
||||||
$this->bootstrap();
|
$this->bootstrap();
|
||||||
|
|
||||||
self::$cookieJar = new CookieJar;
|
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);
|
self::$client = new HttpBrowser(self::$http_client, null, self::$cookieJar);
|
||||||
|
|
||||||
// Clear the language array so that things
|
// Clear the language array so that things
|
||||||
|
|
Loading…
Add table
Reference in a new issue