Security update for permissions_by_term
[yaffs-website] / vendor / drupal / drupal-extension / doc / _static / snippets / subcontext.inc
diff --git a/vendor/drupal/drupal-extension/doc/_static/snippets/subcontext.inc b/vendor/drupal/drupal-extension/doc/_static/snippets/subcontext.inc
new file mode 100644 (file)
index 0000000..cf6247f
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+
+/**
+ * Contains \FooFoo.
+ */
+
+use Behat\Behat\Hook\Scope\BeforeScenarioScope;
+use Behat\Behat\Tester\Exception\PendingException;
+use Drupal\DrupalExtension\Context\DrupalSubContextBase;
+use Drupal\DrupalExtension\Context\DrupalSubContextInterface;
+
+/**
+ * Example subcontext.
+ */
+class FooFoo extends DrupalSubContextBase implements DrupalSubContextInterface {
+
+  /**
+   * @var \Drupal\DrupalExtension\Context\DrupalContext
+   */
+  protected $drupalContext;
+
+  /**
+   * @var \Drupal\DrupalExtension\Context\MinkContext
+   */
+  protected $minkContext;
+
+  /**
+   * @BeforeScenario
+   */
+  public function gatherContexts(BeforeScenarioScope $scope) {
+    $environment = $scope->getEnvironment();
+
+    $this->drupalContext = $environment->getContext('Drupal\DrupalExtension\Context\DrupalContext');
+    $this->minkContext = $environment->getContext('Drupal\DrupalExtension\Context\MinkContext');
+  }
+
+  /**
+   * @Given I create a(an) :arg1 content type
+   */
+  public function CreateAContentType($arg1) {
+    $this->minkContext->assertAtPath("admin/structure/types/add");
+    $node = [
+      'title' => 'Test content!',
+    ];
+    $this->drupalContext->nodeCreate($node);
+  }
+
+  /**
+   * @Then /^I should have a subcontext definition$/
+   */
+  public function assertSubContextDefinition() {
+    throw new PendingException();
+  }
+
+}