diff --git a/tests/steps/panopoly_test.behat.inc b/tests/steps/panopoly_test.behat.inc index fc7eea8..90cd32c 100644 --- a/tests/steps/panopoly_test.behat.inc +++ b/tests/steps/panopoly_test.behat.inc @@ -21,13 +21,6 @@ class TestSubContext extends RawDrupalContext implements DrupalSubContextInterfa private $drupal = NULL; /** - * Contains the DrupalContext (so we can call it's steps). - * - * @var \Drupal\DrupalExtension\Context\DrupalContext - */ - private $drupalContext = NULL; - - /** * An array of Drupal users created by other contexts. * * @var array @@ -56,16 +49,6 @@ class TestSubContext extends RawDrupalContext implements DrupalSubContextInterfa } /** - * Gather contexts to use in our steps. - * - * @BeforeScenario - */ - public function gatherContexts(BeforeScenarioScope $scope) { - $environment = $scope->getEnvironment(); - $this->drupalContext = $environment->getContext('Drupal\DrupalExtension\Context\DrupalContext'); - } - - /** * Get a region by name. * * @param string $region @@ -430,9 +413,14 @@ class TestSubContext extends RawDrupalContext implements DrupalSubContextInterfa * @Given I am viewing a landing page */ public function iAmViewingALandingPage() { - $random = new Random(); - $name = $random->name(8); - $this->drupalContext->createNode('panopoly_test_landing_page', $name); + $node = (object)array( + 'type' => 'panopoly_test_landing_page', + 'title' => $this->getRandom()->name(8), + ); + $saved = $this->nodeCreate($node); + + // Set internal page on the new node. + $this->getSession()->visit($this->locatePath('/node/' . $saved->nid)); } /**