Commit ee952325 authored by catch's avatar catch
Browse files

Issue #3187315 by xjm, longwave: Remove mink-goutte-driver as a core dependency

parent fc51b4b1
......@@ -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",
......
......@@ -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",
......
......@@ -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",
......
......@@ -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",
......
......@@ -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'],
......
......@@ -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'],
......
......@@ -643,7 +643,6 @@ goldfinger
gonner
googleapis
gotit
goutte
grandgrandchild
grandgrandchild's
granularities
......
<?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());
}
}
......@@ -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
......
......@@ -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
*/
......
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment