1 | <?php |
||
11 | class MessageContext extends RawMessageContext |
||
12 | { |
||
13 | /** |
||
14 | * Check that the page have no error messages and fields - error classes. |
||
15 | * |
||
16 | * @throws \RuntimeException |
||
17 | * @throws \Exception |
||
18 | * |
||
19 | * @Then /^(?:|I )should see no errors(?:| on the page)$/ |
||
20 | */ |
||
21 | public function assertNoErrorMessages() |
||
47 | |||
48 | /** |
||
49 | * @example |
||
50 | * I should see the message "Hello, user." |
||
51 | * I should see the error message "An error occured." |
||
52 | * I should not see the success message "Everything fine." |
||
53 | * I should not see the error message "!name field is required." |
||
54 | * | !name | E-mail address | |
||
55 | * |
||
56 | * @param string $negate |
||
57 | * Indicates that user should or should not see message on the page. |
||
58 | * @param string $type |
||
59 | * Message type: error, warning, success. Could be empty. |
||
60 | * @param string $message |
||
61 | * Message to found. Placeholders allowed. |
||
62 | * @param TableNode|array $args |
||
63 | * Placeholders conformity. |
||
64 | * |
||
65 | * @Then /^(?:|I )should(| not) see the (.* )message "([^"]*)"$/ |
||
66 | */ |
||
67 | public function assertMessage($negate, $type, $message, $args = []) |
||
105 | |||
106 | /** |
||
107 | * @example |
||
108 | * Then should see the following error messages: |
||
109 | * | !name field is required. | !name => E-mail address | |
||
110 | * |
||
111 | * @param string $negate |
||
112 | * Indicates that user should or should not see message on the page. |
||
113 | * @param string $type |
||
114 | * Message type: error, warning, success. Could be empty. |
||
115 | * @param TableNode $messages |
||
116 | * Messages to found. Placeholders allowed. |
||
117 | * |
||
118 | * @Then /^(?:|I )should(| not) see the following (.* )messages:$/ |
||
119 | */ |
||
120 | public function assertMessages($negate, $type, TableNode $messages) |
||
137 | } |
||
138 |