diff --git a/behat.yml.dist b/behat.yml.dist index 10c4b191383..781a5c47882 100644 --- a/behat.yml.dist +++ b/behat.yml.dist @@ -6,7 +6,6 @@ default: - 'DoctrineContext': doctrine: '@doctrine' passwordEncoder: '@security.password_encoder' - - 'HttpHeaderContext' - 'GraphqlContext' - 'JsonContext' - 'HydraContext' @@ -45,7 +44,6 @@ postgres: - 'DoctrineContext': doctrine: '@doctrine' passwordEncoder: '@security.password_encoder' - - 'HttpHeaderContext' - 'GraphqlContext' - 'JsonContext' - 'HydraContext' @@ -70,7 +68,6 @@ mongodb: - 'DoctrineContext': doctrine: '@doctrine_mongodb' passwordEncoder: '@security.password_encoder' - - 'HttpHeaderContext' - 'GraphqlContext' - 'JsonContext' - 'HydraContext' @@ -98,7 +95,6 @@ elasticsearch: client: '@test.api_platform.elasticsearch.client' elasticsearchMappingsPath: '%paths.base%/tests/Fixtures/Elasticsearch/Mappings/' elasticsearchFixturesPath: '%paths.base%/tests/Fixtures/Elasticsearch/Fixtures/' - - 'HttpHeaderContext' - 'JsonContext' - 'Behatch\Context\RestContext' - 'Behat\MinkExtension\Context\MinkContext' @@ -113,7 +109,6 @@ default-coverage: - 'DoctrineContext': doctrine: '@doctrine' passwordEncoder: '@security.password_encoder' - - 'HttpHeaderContext' - 'GraphqlContext' - 'JsonContext' - 'HydraContext' @@ -138,7 +133,6 @@ mongodb-coverage: - 'DoctrineContext': doctrine: '@doctrine_mongodb' passwordEncoder: '@security.password_encoder' - - 'HttpHeaderContext' - 'GraphqlContext' - 'JsonContext' - 'HydraContext' @@ -164,7 +158,6 @@ elasticsearch-coverage: client: '@test.api_platform.elasticsearch.client' elasticsearchMappingsPath: '%paths.base%/tests/Fixtures/Elasticsearch/Mappings/' elasticsearchFixturesPath: '%paths.base%/tests/Fixtures/Elasticsearch/Fixtures/' - - 'HttpHeaderContext' - 'JsonContext' - 'CoverageContext' - 'Behatch\Context\RestContext' diff --git a/composer.json b/composer.json index 3a0bba7ee23..dc120bdfc1a 100644 --- a/composer.json +++ b/composer.json @@ -29,10 +29,10 @@ "require-dev": { "behat/behat": "^3.1", "behat/mink": "^1.7", - "behat/mink-browserkit-driver": "^1.3.1", - "behat/mink-extension": "^2.2", + "friends-of-behat/mink-browserkit-driver": "^1.3.1", + "friends-of-behat/mink-extension": "^2.2", "behat/symfony2-extension": "^2.1.1", - "behatch/contexts": "^3.1.0", + "behatch/contexts": "dev-fix/symfony-33393", "doctrine/annotations": "^1.7", "doctrine/common": "^2.11", "doctrine/data-fixtures": "^1.2.2", @@ -121,6 +121,10 @@ { "type": "vcs", "url": "https://github.com/teohhanhui/stubs-mongodb" + }, + { + "type": "vcs", + "url": "https://github.com/dunglas/contexts" } ], "config": { diff --git a/features/bootstrap/GraphqlContext.php b/features/bootstrap/GraphqlContext.php index 4845fbd223c..3541f25005a 100644 --- a/features/bootstrap/GraphqlContext.php +++ b/features/bootstrap/GraphqlContext.php @@ -162,7 +162,6 @@ public function theGraphQLFieldIsDeprecatedForTheReason(string $fieldName, strin private function sendGraphqlRequest() { - $this->request->setHttpHeader('Accept', null); $this->restContext->iSendARequestTo('GET', '/graphql?'.http_build_query($this->graphqlRequest)); } } diff --git a/features/bootstrap/HttpHeaderContext.php b/features/bootstrap/HttpHeaderContext.php deleted file mode 100644 index c8f5c1e4ef2..00000000000 --- a/features/bootstrap/HttpHeaderContext.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -use Behat\Behat\Context\Context; -use Behat\Behat\Hook\Scope\AfterStepScope; -use Behatch\HttpCall\Request; - -final class HttpHeaderContext implements Context -{ - private $request; - - public function __construct(Request $request) - { - $this->request = $request; - } - - /** - * Sets the default Accept HTTP header to null (workaround to artificially remove it). - * - * @AfterStep - */ - public function removeAcceptHeaderAfterRequest(AfterStepScope $event) - { - if (preg_match('/^I send a "[A-Z]+" request to ".+"/', $event->getStep()->getText())) { - $this->request->setHttpHeader('Accept', null); - } - } - - /** - * Sets the default Accept HTTP header to null (workaround to artificially remove it). - * - * @BeforeScenario - */ - public function removeAcceptHeaderBeforeScenario() - { - $this->request->setHttpHeader('Accept', null); - } -}