Completed
Pull Request — 3.1 (#354)
by
unknown
07:39
created

FooFoo::assertSubContextDefinition()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * Contains \FooFoo.
5
 */
6
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;
11
12
/**
13
 * Example subcontext.
14
 */
15
class FooFoo extends DrupalSubContextBase implements DrupalSubContextInterface {
16
17
  /**
18
   * @var \Drupal\DrupalExtension\Context\DrupalContext
19
   */
20
  protected $drupalContext;
21
22
  /**
23
   * @var \Drupal\DrupalExtension\Context\MinkContext
24
   */
25
  protected $minkContext;
26
27
  /**
28
   * @BeforeScenario
29
   */
30
  public function gatherContexts(BeforeScenarioScope $scope) {
31
    $environment = $scope->getEnvironment();
32
33
    $this->drupalContext = $environment->getContext('Drupal\DrupalExtension\Context\DrupalContext');
34
    $this->minkContext = $environment->getContext('Drupal\DrupalExtension\Context\MinkContext');
35
  }
36
37
  /**
38
   * @Given I create a(an) :arg1 content type
39
   */
40
  public function CreateAContentType($arg1) {
0 ignored issues
show
Unused Code introduced by
The parameter $arg1 is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
41
    $this->minkContext->assertAtPath("admin/structure/types/add");
42
    $node = [
43
      'title' => 'Test content!',
44
    ];
45
    $this->drupalContext->nodeCreate($node);
46
  }
47
48
  /**
49
   * @Then /^I should have a subcontext definition$/
50
   */
51
  public function assertSubContextDefinition() {
52
    throw new PendingException();
53
  }
54
55
}
56