7 use Behat\Behat\Hook\Scope\BeforeScenarioScope;
8 use Behat\Behat\Tester\Exception\PendingException;
9 use Drupal\DrupalExtension\Context\DrupalSubContextBase;
10 use Drupal\DrupalExtension\Context\DrupalSubContextInterface;
15 class FooFoo extends DrupalSubContextBase implements DrupalSubContextInterface {
18 * @var \Drupal\DrupalExtension\Context\DrupalContext
20 protected $drupalContext;
23 * @var \Drupal\DrupalExtension\Context\MinkContext
25 protected $minkContext;
30 public function gatherContexts(BeforeScenarioScope $scope) {
31 $environment = $scope->getEnvironment();
33 $this->drupalContext = $environment->getContext('Drupal\DrupalExtension\Context\DrupalContext');
34 $this->minkContext = $environment->getContext('Drupal\DrupalExtension\Context\MinkContext');
38 * @Given I create a(an) :arg1 content type
40 public function CreateAContentType($arg1) {
41 $this->minkContext->assertAtPath("admin/structure/types/add");
43 'title' => 'Test content!',
45 $this->drupalContext->nodeCreate($node);
49 * @Then /^I should have a subcontext definition$/
51 public function assertSubContextDefinition() {
52 throw new PendingException();