File tree Expand file tree Collapse file tree 2 files changed +27
-3
lines changed Expand file tree Collapse file tree 2 files changed +27
-3
lines changed Original file line number Diff line number Diff line change 35
35
"white-october/pagerfanta-bundle" : " ^1.1"
36
36
},
37
37
"require-dev" : {
38
- "codeception/codeception" : " 2.5 .x-dev" ,
38
+ "codeception/codeception" : " 3.0 .x-dev" ,
39
39
"friendsofphp/php-cs-fixer" : " ^2.7" ,
40
40
"symfony/browser-kit" : " ^4.0" ,
41
41
"symfony/css-selector" : " ^4.0" ,
Original file line number Diff line number Diff line change @@ -21,7 +21,31 @@ public function createComment(FunctionalTester $I)
21
21
$ I ->submitForm ('#post-add-comment > form ' , []);
22
22
$ I ->seeCurrentRouteIs ('blog_post ' );
23
23
$ I ->see ('Hi, Symfony! ' );
24
- $ I ->seeInRepository (Comment::class, ['content ' => 'Hi, Symfony! ' ]);
24
+ // This particular assertion is a bit of overkill, but it also serves as a testcase
25
+ // of `seeInRepository` method with complex associations. Here is how this assertion
26
+ // translates to English:
27
+ //
28
+ // * I see a comment entity with content equal to 'Hi, Symfony!'
29
+ // * and 'author' association points to a user entity with username equal to 'john_user'
30
+ // ** note: john_user is one who created the comment, as it is used in login
31
+ // procedure above
32
+ // * and 'post' association points to a post entity which...
33
+ // * ...has an associated comment entity which...
34
+ // * ...has same content and author with same username.
35
+ $ I ->seeInRepository (Comment::class, [
36
+ 'content ' => 'Hi, Symfony! ' ,
37
+ 'author ' => [
38
+ 'username ' => 'john_user ' ,
39
+ ],
40
+ 'post ' => [
41
+ 'comments ' => [
42
+ 'content ' => 'Hi, Symfony! ' ,
43
+ 'author ' => [
44
+ 'username ' => 'john_user '
45
+ ]
46
+ ]
47
+ ]
48
+ ]);
25
49
}
26
50
27
- }
51
+ }
You can’t perform that action at this time.
0 commit comments