diff --git a/composer.json b/composer.json index c2fdd0e9e5675c75db232fe927378401f5c56a41..c137ad2ab4c90bcf03c4868929c93f39e4ceebc5 100644 --- a/composer.json +++ b/composer.json @@ -17,11 +17,9 @@ "require-dev": { "behat/mink": "^1.8", "friends-of-behat/mink-browserkit-driver": "^1.4", - "behat/mink-goutte-driver": "^1.2", "behat/mink-selenium2-driver": "^1.4", "composer/composer": "^2.0.2", "drupal/coder": "^8.3.10", - "fabpot/goutte": "^3.3", "instaclick/php-webdriver": "^1.4.1", "mikey179/vfsstream": "^1.6.8", "phpunit/phpunit": "^8.5.14 || ^9", diff --git a/composer.lock b/composer.lock index ba80cf057c8672bcb7156bf2882d349515ba5309..72e7315510da193c2f503b8acbfee1903aa33da4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "aa10a6259c46de99ced09082eea4368a", + "content-hash": "8d45389b3d0ae61b9494521b92723562", "packages": [ { "name": "asm89/stack-cors", @@ -3639,16 +3639,16 @@ }, { "name": "symfony/psr-http-message-bridge", - "version": "v2.1.0", + "version": "v2.1.1", "source": { "type": "git", "url": "https://github.com/symfony/psr-http-message-bridge.git", - "reference": "81db2d4ae86e9f0049828d9343a72b9523884e5d" + "reference": "c9012994c4b4fb23e7c57dd86b763a417a04feba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/81db2d4ae86e9f0049828d9343a72b9523884e5d", - "reference": "81db2d4ae86e9f0049828d9343a72b9523884e5d", + "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/c9012994c4b4fb23e7c57dd86b763a417a04feba", + "reference": "c9012994c4b4fb23e7c57dd86b763a417a04feba", "shasum": "" }, "require": { @@ -3658,7 +3658,7 @@ }, "require-dev": { "nyholm/psr7": "^1.1", - "psr/log": "^1.1", + "psr/log": "^1.1 || ^2 || ^3", "symfony/browser-kit": "^4.4 || ^5.0", "symfony/config": "^4.4 || ^5.0", "symfony/event-dispatcher": "^4.4 || ^5.0", @@ -3707,7 +3707,7 @@ ], "support": { "issues": "https://github.com/symfony/psr-http-message-bridge/issues", - "source": "https://github.com/symfony/psr-http-message-bridge/tree/v2.1.0" + "source": "https://github.com/symfony/psr-http-message-bridge/tree/v2.1.1" }, "funding": [ { @@ -3723,7 +3723,7 @@ "type": "tidelift" } ], - "time": "2021-02-17T10:35:25+00:00" + "time": "2021-07-27T17:25:39+00:00" }, { "name": "symfony/routing", @@ -4621,65 +4621,6 @@ }, "time": "2020-03-11T15:45:53+00:00" }, - { - "name": "behat/mink-goutte-driver", - "version": "v1.2.1", - "source": { - "type": "git", - "url": "https://github.com/minkphp/MinkGoutteDriver.git", - "reference": "8b9ad6d2d95bc70b840d15323365f52fcdaea6ca" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/minkphp/MinkGoutteDriver/zipball/8b9ad6d2d95bc70b840d15323365f52fcdaea6ca", - "reference": "8b9ad6d2d95bc70b840d15323365f52fcdaea6ca", - "shasum": "" - }, - "require": { - "behat/mink": "~1.6@dev", - "behat/mink-browserkit-driver": "~1.2@dev", - "fabpot/goutte": "~1.0.4|~2.0|~3.1", - "php": ">=5.3.1" - }, - "require-dev": { - "symfony/phpunit-bridge": "~2.7|~3.0" - }, - "type": "mink-driver", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Behat\\Mink\\Driver\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Goutte driver for Mink framework", - "homepage": "http://mink.behat.org/", - "keywords": [ - "browser", - "goutte", - "headless", - "testing" - ], - "support": { - "issues": "https://github.com/minkphp/MinkGoutteDriver/issues", - "source": "https://github.com/minkphp/MinkGoutteDriver/tree/master" - }, - "time": "2016-03-05T09:04:22+00:00" - }, { "name": "behat/mink-selenium2-driver", "version": "v1.4.0", @@ -5318,65 +5259,6 @@ }, "time": "2020-12-02T08:47:31+00:00" }, - { - "name": "fabpot/goutte", - "version": "v3.3.1", - "source": { - "type": "git", - "url": "https://github.com/FriendsOfPHP/Goutte.git", - "reference": "80a23b64f44d54dd571d114c473d9d7e9ed84ca5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/80a23b64f44d54dd571d114c473d9d7e9ed84ca5", - "reference": "80a23b64f44d54dd571d114c473d9d7e9ed84ca5", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": "^6.0", - "php": ">=7.1.3", - "symfony/browser-kit": "^4.4|^5.0", - "symfony/css-selector": "^4.4|^5.0", - "symfony/dom-crawler": "^4.4|^5.0" - }, - "require-dev": { - "symfony/phpunit-bridge": "^5.0" - }, - "type": "application", - "extra": { - "branch-alias": { - "dev-master": "3.3-dev" - } - }, - "autoload": { - "psr-4": { - "Goutte\\": "Goutte" - }, - "exclude-from-classmap": [ - "Goutte/Tests" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "A simple PHP Web Scraper", - "homepage": "https://github.com/FriendsOfPHP/Goutte", - "keywords": [ - "scraper" - ], - "support": { - "issues": "https://github.com/FriendsOfPHP/Goutte/issues", - "source": "https://github.com/FriendsOfPHP/Goutte/tree/v3.3.1" - }, - "time": "2020-11-01T09:30:18+00:00" - }, { "name": "friends-of-behat/mink-browserkit-driver", "version": "v1.5.0", diff --git a/composer/Metapackage/CoreRecommended/composer.json b/composer/Metapackage/CoreRecommended/composer.json index ef3fde763fd8d64227a910ad0ffa063e6b72de87..36f957269586b47d85005e7692f649b42dab16b9 100644 --- a/composer/Metapackage/CoreRecommended/composer.json +++ b/composer/Metapackage/CoreRecommended/composer.json @@ -53,7 +53,7 @@ "symfony/polyfill-mbstring": "v1.23.0", "symfony/polyfill-php80": "v1.23.0", "symfony/process": "v4.4.27", - "symfony/psr-http-message-bridge": "v2.1.0", + "symfony/psr-http-message-bridge": "v2.1.1", "symfony/routing": "v4.4.27", "symfony/serializer": "v4.4.27", "symfony/service-contracts": "v2.4.0", diff --git a/composer/Metapackage/DevDependencies/composer.json b/composer/Metapackage/DevDependencies/composer.json index d0955f8ec813553cdb33facfdf69321a41773ab7..32b5862971c29fcacced2e1e2a0ef15bfc9ab05b 100644 --- a/composer/Metapackage/DevDependencies/composer.json +++ b/composer/Metapackage/DevDependencies/composer.json @@ -8,12 +8,10 @@ }, "require": { "behat/mink": "^1.8", - "behat/mink-goutte-driver": "^1.2", "behat/mink-selenium2-driver": "^1.4", "composer/composer": "^2.0.2", "drupal/coder": "^8.3.10", "easyrdf/easyrdf": "^0.9 || ^1.0", - "fabpot/goutte": "^3.3", "friends-of-behat/mink-browserkit-driver": "^1.4", "instaclick/php-webdriver": "^1.4.1", "justinrainbow/json-schema": "^5.2", diff --git a/composer/Metapackage/PinnedDevDependencies/composer.json b/composer/Metapackage/PinnedDevDependencies/composer.json index 074ff2d90a03d970ff07d97e0205ccf0a9582b03..c74c86e8edf4459de684ade86fd89c3db0fdb31f 100644 --- a/composer/Metapackage/PinnedDevDependencies/composer.json +++ b/composer/Metapackage/PinnedDevDependencies/composer.json @@ -9,7 +9,6 @@ "require": { "drupal/core": "9.3.x-dev", "behat/mink": "v1.8.1", - "behat/mink-goutte-driver": "v1.2.1", "behat/mink-selenium2-driver": "v1.4.0", "composer/ca-bundle": "1.2.10", "composer/composer": "2.1.5", @@ -19,7 +18,6 @@ "doctrine/instantiator": "1.4.0", "drupal/coder": "8.3.13", "easyrdf/easyrdf": "1.1.1", - "fabpot/goutte": "v3.3.1", "friends-of-behat/mink-browserkit-driver": "v1.5.0", "instaclick/php-webdriver": "1.4.9", "justinrainbow/json-schema": "5.2.11", diff --git a/composer/Plugin/VendorHardening/Config.php b/composer/Plugin/VendorHardening/Config.php index 9cb9ed4dad8046c4eff196894fcf4b037d3d7fb7..b6323875687421d1c36067b588c48a5c87adb315 100644 --- a/composer/Plugin/VendorHardening/Config.php +++ b/composer/Plugin/VendorHardening/Config.php @@ -21,7 +21,6 @@ class Config { */ protected static $defaultConfig = [ 'behat/mink' => ['tests', 'driver-testsuite'], - 'behat/mink-goutte-driver' => ['tests'], 'behat/mink-selenium2-driver' => ['tests'], 'composer/composer' => ['bin'], 'drupal/coder' => [ @@ -31,7 +30,6 @@ class Config { 'doctrine/instantiator' => ['tests'], 'easyrdf/easyrdf' => ['scripts'], 'egulias/email-validator' => ['documentation', 'tests'], - 'fabpot/goutte' => ['Goutte/Tests'], 'friends-of-behat/mink-browserkit-driver' => ['tests'], 'guzzlehttp/promises' => ['tests'], 'guzzlehttp/psr7' => ['tests'], diff --git a/core/lib/Drupal/Core/Composer/Composer.php b/core/lib/Drupal/Core/Composer/Composer.php index 4431ff30e3f59999a724dc028f697d4e2cb30114..3041dab3a7775cdb7452e66131ce158fbe01ea41 100644 --- a/core/lib/Drupal/Core/Composer/Composer.php +++ b/core/lib/Drupal/Core/Composer/Composer.php @@ -17,14 +17,12 @@ class Composer { protected static $packageToCleanup = [ 'behat/mink' => ['tests', 'driver-testsuite'], - 'behat/mink-goutte-driver' => ['tests'], 'behat/mink-selenium2-driver' => ['tests'], 'composer/composer' => ['bin'], 'drupal/coder' => ['coder_sniffer/Drupal/Test', 'coder_sniffer/DrupalPractice/Test'], 'doctrine/instantiator' => ['tests'], 'easyrdf/easyrdf' => ['scripts'], 'egulias/email-validator' => ['documentation', 'tests'], - 'fabpot/goutte' => ['Goutte/Tests'], 'friends-of-behat/mink-browserkit-driver' => ['tests'], 'guzzlehttp/promises' => ['tests'], 'guzzlehttp/psr7' => ['tests'], diff --git a/core/misc/cspell/dictionary.txt b/core/misc/cspell/dictionary.txt index 53cfc3332a17fd2ac7de7ae70cf13038627dddda..0a387a3d897bac3194df21205fa9146c533d672a 100644 --- a/core/misc/cspell/dictionary.txt +++ b/core/misc/cspell/dictionary.txt @@ -643,7 +643,6 @@ goldfinger gonner googleapis gotit -goutte grandgrandchild grandgrandchild's granularities diff --git a/core/tests/Drupal/FunctionalTests/GoutteDriverTest.php b/core/tests/Drupal/FunctionalTests/GoutteDriverTest.php deleted file mode 100644 index fc29fb6e9cba5995e542dcda82000e89e97cd3fb..0000000000000000000000000000000000000000 --- a/core/tests/Drupal/FunctionalTests/GoutteDriverTest.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php - -namespace Drupal\FunctionalTests; - -use Behat\Mink\Driver\GoutteDriver; -use Drupal\Core\Url; -use Drupal\Tests\BrowserTestBase; - -/** - * Tests legacy support for GoutteDriver. - * - * @group browsertestbase - */ -class GoutteDriverTest extends BrowserTestBase { - - /** - * {@inheritdoc} - */ - protected $minkDefaultDriverClass = GoutteDriver::class; - - /** - * Modules to enable. - * - * @var array - */ - protected static $modules = [ - 'test_page_test', - ]; - - /** - * {@inheritdoc} - */ - protected $defaultTheme = 'stark'; - - /** - * Tests basic page test. - * - * @group legacy - */ - public function testGoTo() { - $this->expectDeprecation('Using \Behat\Mink\Driver\GoutteDriver is deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. The dependencies behat/mink-goutte-driver and fabpot/goutte will be removed. See https://www.drupal.org/node/3177235'); - $account = $this->drupalCreateUser(); - $this->drupalLogin($account); - - // Visit a Drupal page that requires login. - $this->drupalGet('test-page'); - $this->assertSession()->statusCodeEquals(200); - - // Test page contains some text. - $this->assertSession()->pageTextContains('Test page text.'); - - // Check that returned plain text is correct. - $text = $this->getTextContent(); - $this->assertStringContainsString('Test page text.', $text); - $this->assertStringNotContainsString('</html>', $text); - - // Response includes cache tags that we can assert. - $this->assertSession()->responseHeaderExists('X-Drupal-Cache-Tags'); - $this->assertSession()->responseHeaderEquals('X-Drupal-Cache-Tags', 'http_response rendered'); - - // Test that we can read the JS settings. - $js_settings = $this->getDrupalSettings(); - $this->assertSame('azAZ09();.,\\\/-_{}', $js_settings['test-setting']); - - // Test drupalGet with a url object. - $url = Url::fromRoute('test_page_test.render_title'); - $this->drupalGet($url); - $this->assertSession()->statusCodeEquals(200); - - // Test page contains some text. - $this->assertSession()->pageTextContains('Hello Drupal'); - - // Ensure that \Drupal\Tests\UiHelperTrait::isTestUsingGuzzleClient() works - // as expected. - $this->assertTrue($this->isTestUsingGuzzleClient()); - } - -} diff --git a/core/tests/Drupal/Tests/BrowserTestBase.php b/core/tests/Drupal/Tests/BrowserTestBase.php index 29dee384c92291adaff980d75ccfc6d34b65b87d..1855e15773600294f701c990a50bba53060c12d8 100644 --- a/core/tests/Drupal/Tests/BrowserTestBase.php +++ b/core/tests/Drupal/Tests/BrowserTestBase.php @@ -3,7 +3,6 @@ namespace Drupal\Tests; use Behat\Mink\Driver\BrowserKitDriver; -use Behat\Mink\Driver\GoutteDriver; use Behat\Mink\Element\Element; use Behat\Mink\Mink; use Behat\Mink\Selector\SelectorsHandler; @@ -234,9 +233,6 @@ public static function setUpBeforeClass() { */ protected function initMink() { $driver = $this->getDefaultDriverInstance(); - if ($driver instanceof GoutteDriver) { - @trigger_error('Using \Behat\Mink\Driver\GoutteDriver is deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. The dependencies behat/mink-goutte-driver and fabpot/goutte will be removed. See https://www.drupal.org/node/3177235', E_USER_DEPRECATED); - } if ($driver instanceof BrowserKitDriver) { // Turn off curl timeout. Having a timeout is not a problem in a normal diff --git a/core/tests/Drupal/Tests/Core/Test/BrowserTestBaseTest.php b/core/tests/Drupal/Tests/Core/Test/BrowserTestBaseTest.php index b377393c264e3bc2dee16219c4522d1831cfe88d..dee828d802658413946bee190e886082e41ce8ac 100644 --- a/core/tests/Drupal/Tests/Core/Test/BrowserTestBaseTest.php +++ b/core/tests/Drupal/Tests/Core/Test/BrowserTestBaseTest.php @@ -2,13 +2,11 @@ namespace Drupal\Tests\Core\Test; -use Behat\Mink\Driver\GoutteDriver; use Drupal\Tests\DrupalTestBrowser; use Drupal\Tests\UnitTestCase; use Drupal\Tests\BrowserTestBase; use Behat\Mink\Driver\BrowserKitDriver; use Behat\Mink\Session; -use Goutte\Client; /** * @coversDefaultClass \Drupal\Tests\BrowserTestBase @@ -60,32 +58,6 @@ public function testGetHttpClient() { $this->assertSame(get_class($expected), get_class($ref_gethttpclient->invoke($btb))); } - /** - * @covers ::getHttpClient - * - * @group legacy - */ - public function testGetHttpClientGoutte() { - // Our stand-in for the Guzzle client object. - $expected = new \stdClass(); - - $browserkit_client = $this->getMockBuilder(Client::class) - ->setMethods(['getClient']) - ->getMockForAbstractClass(); - $browserkit_client->expects($this->once()) - ->method('getClient') - ->willReturn($expected); - - // Because the driver is a GoutteDriver, we'll get back a client. - $driver = new GoutteDriver($browserkit_client); - $btb = $this->mockBrowserTestBaseWithDriver($driver); - - $ref_gethttpclient = new \ReflectionMethod($btb, 'getHttpClient'); - $ref_gethttpclient->setAccessible(TRUE); - - $this->assertSame(get_class($expected), get_class($ref_gethttpclient->invoke($btb))); - } - /** * @covers ::getHttpClient */ diff --git a/core/tests/Drupal/Tests/UiHelperTrait.php b/core/tests/Drupal/Tests/UiHelperTrait.php index fe4c7ebd72544ec0423dfcfb2e4bca72c3eb955b..cd0b7dea74e18e2c986c8133d732d468459ce0d5 100644 --- a/core/tests/Drupal/Tests/UiHelperTrait.php +++ b/core/tests/Drupal/Tests/UiHelperTrait.php @@ -3,7 +3,6 @@ namespace Drupal\Tests; use Behat\Mink\Driver\BrowserKitDriver; -use Behat\Mink\Driver\GoutteDriver; use Drupal\Component\Render\FormattableMarkup; use Drupal\Component\Utility\Html; use Drupal\Component\Utility\UrlHelper; @@ -586,10 +585,6 @@ protected function cssSelectToXpath($selector, $html = TRUE, $prefix = 'descenda */ protected function isTestUsingGuzzleClient() { $driver = $this->getSession()->getDriver(); - if ($driver instanceof GoutteDriver) { - // Legacy support of GoutteDriver. - return TRUE; - } if ($driver instanceof BrowserKitDriver) { return $driver->getClient() instanceof DrupalTestBrowser; }