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 = []) |
||
98 | |||
99 | /** |
||
100 | * @example |
||
101 | * Then should see the following error messages: |
||
102 | * | !name field is required. | !name => E-mail address | |
||
103 | * |
||
104 | * @param string $negate |
||
105 | * Indicates that user should or should not see message on the page. |
||
106 | * @param string $type |
||
107 | * Message type: error, warning, success. Could be empty. |
||
108 | * @param TableNode $messages |
||
109 | * Messages to found. Placeholders allowed. |
||
110 | * |
||
111 | * @Then /^(?:|I )should(| not) see the following (.* )messages:$/ |
||
112 | */ |
||
113 | public function assertMessages($negate, $type, TableNode $messages) |
||
130 | } |
||
131 |