Skip to content

Commit

Permalink
Move it in ::load()
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiu-cristea committed Dec 23, 2022
1 parent e6b58d5 commit 8201d7e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
5 changes: 1 addition & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@
"Drupal\\Exception": "src/",
"Drupal\\DrupalExtension": "src/",
"Drupal\\MinkExtension": "src/"
},
"classmap": [
"src/Drupal/DocumentElement.php"
]
}
},
"extra": {
"branch-alias": {
Expand Down
12 changes: 6 additions & 6 deletions src/Drupal/DrupalExtension/ServiceContainer/DrupalExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@ class DrupalExtension implements ExtensionInterface
public function __construct(ServiceProcessor $processor = null)
{
$this->processor = $processor ? : new ServiceProcessor();

// Workaround a bug in BrowserKitDriver that wrongly considers as text
// of the page, pieces of texts inside the <head> section.
// @see https://github.com/minkphp/MinkBrowserKitDriver/issues/153
// @see https://www.drupal.org/project/drupal/issues/3175718
class_alias('\Drupal\DocumentElement', '\Behat\Mink\Element\DocumentElement', true);
}

/**
Expand All @@ -69,6 +63,12 @@ public function initialize(ExtensionManager $extensionManager)
*/
public function load(ContainerBuilder $container, array $config)
{
// Workaround a bug in BrowserKitDriver that wrongly considers as text
// of the page, pieces of texts inside the <head> section.
// @see https://github.com/minkphp/MinkBrowserKitDriver/issues/153
// @see https://www.drupal.org/project/drupal/issues/3175718
class_alias('\Drupal\DocumentElement', '\Behat\Mink\Element\DocumentElement', true);

$loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/config'));
$loader->load('services.yml');
$container->setParameter('drupal.drupal.default_driver', $config['default_driver']);
Expand Down

0 comments on commit 8201d7e

Please sign in to comment.