Security update for permissions_by_term
[yaffs-website] / vendor / drupal / drupal-extension / features / subcontexts / find.feature
1 Feature: Ability to find Drupal sub-contexts
2   In order to facilitate maintainable step-definitions
3   As a feature developer
4   I need to be able to define step-definitions within corresponding Drupal modules or projects
5
6   Background:
7     Given a file named "foo.behat.inc" with:
8       """
9       <?php
10
11       use Behat\Behat\Tester\Exception\PendingException;
12
13       use Drupal\DrupalExtension\Context\DrupalSubContextInterface;
14       use Drupal\DrupalDriverManager;
15
16       class FooFoo implements DrupalSubContextInterface {
17
18         private $drupal;
19
20         public function __construct(DrupalDriverManager $drupal) {
21           $this->drupal = $drupal;
22         }
23
24         /**
25          * @Then /^I should have a subcontext definition$/
26          */
27         public function assertSubContextDefinition() {
28           throw new PendingException();
29         }
30       }
31       """
32     And a file named "features/foo.feature" with:
33       """
34       Feature: Test foo subcontext
35
36         Scenario: Test foo subcontext
37           Given I should have a subcontext definition
38       """
39     And a file named "behat.yml" with:
40       """
41       default:
42         suites:
43           default:
44             contexts: [Drupal\DrupalExtension\Context\DrupalContext]
45         extensions:
46           Behat\MinkExtension:
47             goutte: ~
48             selenium2: ~
49             base_url: http://drupal.org
50           Drupal\DrupalExtension:
51             blackbox: ~
52             subcontexts:
53               paths: { foo: './' }
54       """
55
56   Scenario: Step-definitions in sub-contexts are available
57    When I run "behat --no-colors -dl"
58    Then the output should contain:
59       """
60       Then /^I should have a subcontext definition$/
61       """
62
63  Scenario: Subcontext can be instantiated
64    When I run "behat --no-colors"
65    Then the output should contain:
66      """
67      TODO: write pending definition
68      """