1 | <?php |
||
3 | class ContactFormCest |
||
4 | { |
||
5 | public function _before(\FunctionalTester $I) |
||
6 | { |
||
7 | $I->amOnPage(['site/contact']); |
||
8 | } |
||
9 | |||
10 | public function openContactPage(\FunctionalTester $I) |
||
11 | { |
||
12 | $I->see('Contact', 'h1'); |
||
13 | } |
||
14 | |||
15 | public function submitEmptyForm(\FunctionalTester $I) |
||
25 | } |
||
26 | |||
27 | public function submitFormWithIncorrectEmail(\FunctionalTester $I) |
||
28 | { |
||
29 | $I->submitForm('#contact-form', [ |
||
30 | 'ContactForm[name]' => 'tester', |
||
31 | 'ContactForm[email]' => 'tester.email', |
||
32 | 'ContactForm[subject]' => 'test subject', |
||
33 | 'ContactForm[body]' => 'test content', |
||
34 | 'ContactForm[verifyCode]' => 'testme', |
||
35 | ]); |
||
36 | $I->expectTo('see that email address is wrong'); |
||
37 | $I->dontSee('Name cannot be blank', '.help-inline'); |
||
38 | $I->see('Email is not a valid email address.'); |
||
39 | $I->dontSee('Subject cannot be blank', '.help-inline'); |
||
40 | $I->dontSee('Body cannot be blank', '.help-inline'); |
||
41 | $I->dontSee('The verification code is incorrect', '.help-inline'); |
||
42 | } |
||
43 | |||
44 | public function submitFormSuccessfully(\FunctionalTester $I) |
||
56 | } |
||
57 | } |
||
58 |