[ticket/17176] Use BrowserKit instead of Goutte

PHPBB3-17176
This commit is contained in:
Marc Alexander 2023-08-19 13:05:38 +02:00
parent cef8aaf1a4
commit 2d7c668a28
No known key found for this signature in database
GPG key ID: 50E0D2423696F995
2 changed files with 9 additions and 3 deletions

View file

@ -62,7 +62,7 @@ class core extends Extension
if ($config['require_dev_dependencies'])
{
if (!class_exists('Goutte\Client', true))
if (!class_exists('Symfony\Component\BrowserKit\HttpBrowser'))
{
trigger_error(
'Composer development dependencies have not been set up for the ' . $container->getParameter('core.environment') . ' environment yet, run ' .

View file

@ -11,12 +11,17 @@
*
*/
use Symfony\Component\BrowserKit\CookieJar;
use Symfony\Component\BrowserKit\HttpBrowser;
use Symfony\Component\HttpClient\HttpClient;
require_once __DIR__ . '/mock/phpbb_mock_null_installer_task.php';
class phpbb_functional_test_case extends phpbb_test_case
{
/** @var \Goutte\Client */
/** @var HttpClient */
protected static $http_client;
/** @var HttpBrowser */
protected static $client;
protected static $cookieJar;
protected static $root_url;
@ -89,7 +94,8 @@ class phpbb_functional_test_case extends phpbb_test_case
$this->bootstrap();
self::$cookieJar = new CookieJar;
self::$client = new Goutte\Client(array(), null, self::$cookieJar);
self::$http_client = HttpClient::create();
self::$client = new HttpBrowser(self::$http_client, null, self::$cookieJar);
// Clear the language array so that things
// that were added in other tests are gone