1 | <?php |
||
24 | class FeatureContext extends MinkContext |
||
25 | { |
||
26 | /** |
||
27 | * @var \Interop\Container\ContainerInterface |
||
28 | */ |
||
29 | private static $container; |
||
30 | |||
31 | /** |
||
32 | * Initializes context. |
||
33 | * Every scenario gets it's own context object. |
||
34 | * |
||
35 | * @param array $parameters context parameters (set them up through behat.yml) |
||
|
|||
36 | */ |
||
37 | public function __construct() |
||
41 | |||
42 | /** |
||
43 | * @BeforeSuite |
||
44 | */ |
||
45 | static public function iniializeContainer() |
||
46 | { |
||
47 | if (self::$container === null) { |
||
48 | self::$container = require __DIR__ . '/../../config/container.php'; |
||
49 | } |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * @BeforeFeature |
||
54 | */ |
||
55 | public static function clearDatabase() |
||
56 | { |
||
57 | $em = self::$container->get('doctrine.entitymanager.orm_default'); |
||
58 | $q = $em->createQuery('delete from Codeliner\CargoBackend\Model\Cargo\Cargo'); |
||
59 | $q->execute(); |
||
60 | } |
||
61 | |||
62 | /** |
||
63 | * @Given /^I click the submit button$/ |
||
64 | */ |
||
65 | public function iClickTheSubmitButton() |
||
66 | { |
||
67 | $session = $this->getSession(); |
||
68 | $page = $session->getPage(); |
||
69 | |||
70 | $submit = $page->find('css', 'form input[type=submit]'); |
||
71 | |||
72 | if ($submit) { |
||
73 | $submit->click(); |
||
74 | } else { |
||
75 | throw new \RuntimeException("Can not find the submit btn"); |
||
76 | } |
||
77 | } |
||
78 | |||
79 | /** |
||
80 | * @Then /^I should wait until I see "([^"]*)"$/ |
||
81 | */ |
||
82 | public function iShouldSeeAvailableRoutes($arg1) |
||
83 | { |
||
84 | $this->getSession()->wait(5000, '(0 === jQuery.active)'); |
||
85 | |||
86 | $this->assertElementOnPage($arg1); |
||
87 | } |
||
88 | |||
89 | /** |
||
90 | * @When /^I click on first item in the list "([^"]*)"$/ |
||
91 | */ |
||
92 | public function iClickOnFirstItemInTheList($arg1) |
||
93 | { |
||
94 | $session = $this->getSession(); |
||
95 | $page = $session->getPage(); |
||
96 | |||
97 | $ul = $page->find('css', '#cargo-list'); |
||
98 | |||
99 | $li = $ul->find('css', 'li'); |
||
100 | |||
101 | $li->find('css', 'a')->click(); |
||
102 | } |
||
103 | |||
104 | /** |
||
105 | * @When /^I follow first "([^"]*)" link$/ |
||
106 | */ |
||
107 | public function iFollowFirstLink($arg1) |
||
108 | { |
||
109 | $page = $this->getSession()->getPage(); |
||
110 | |||
111 | $link = $page->find('css', $arg1); |
||
112 | |||
113 | if ($link) { |
||
114 | $link->click(); |
||
115 | } |
||
116 | } |
||
117 | |||
118 | /** |
||
119 | * @Given /^I wait until I am on page "(?P<page>[^"]+)"$/ |
||
120 | */ |
||
121 | public function iWaitUntilIAmOnPage($page) |
||
137 | |||
138 | } |
||
139 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.