File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ use App \Tests \FunctionalTester ;
4
+ use Codeception \Util \HttpCode ;
5
+
6
+ $ I = new FunctionalTester ($ scenario );
7
+ $ I ->am ('Regular user ' );
8
+ $ I ->wantTo ('add new comment to post and see it ' );
9
+ $ I ->amOnPage ('/en/login ' );
10
+ $ I ->seeResponseCodeIs (HttpCode::OK );
11
+ $ I ->fillField ('_username ' , 'john_user ' );
12
+ $ I ->fillField ('_password ' , 'kitten ' );
13
+ $ I ->submitForm ('.well form ' , []);
14
+ $ I ->seeResponseCodeIs (HttpCode::OK );
15
+ $ I ->seeCurrentRouteIs ('blog_index ' );
16
+ $ I ->click ('article.post > h2 a ' );
17
+ $ I ->seeResponseCodeIs (HttpCode::OK );
18
+ $ I ->seeCurrentRouteIs ('blog_post ' );
19
+ $ I ->dontSee ('Hi, Symfony! ' );
20
+ $ I ->fillField ('comment[content] ' , 'Hi, Symfony! ' );
21
+ $ I ->submitForm ('#post-add-comment > form ' , []);
22
+ $ I ->seeCurrentRouteIs ('blog_post ' );
23
+ $ I ->see ('Hi, Symfony! ' );
24
+ $ I ->seeInRepository (\App \Entity \Comment::class, ['content ' => 'Hi, Symfony! ' ]);
You can’t perform that action at this time.
0 commit comments