File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed
more-readable-code-avoiding-builder-pattern Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -42,17 +42,17 @@ function test_user_is_able_to_edit_video_with_enough_access_level(): void
4242{
4343 $ user = new User ('some-id ' , 'some-name ' , 3 );
4444
45- assert (true , $ user ->canEditVideos ());
45+ assertThat (true , $ user ->canEditVideos ());
4646}
4747
4848function test_user_is_not_able_to_edit_videos_without_enough_access_level (): void
4949{
5050 $ user = new User ('some-id ' , 'some-name ' , 1 );
5151
52- assert (false , $ user ->canEditVideos ());
52+ assertThat (false , $ user ->canEditVideos ());
5353}
5454
55- function assert (bool $ expected , bool $ actual ): void
55+ function assertThat (bool $ expected , bool $ actual ): void
5656{
5757 if ($ expected !== $ actual ) {
5858 throw new Exception ('Condition not satisfied ' );
Original file line number Diff line number Diff line change @@ -69,17 +69,17 @@ function test_user_is_able_to_edit_video_with_enough_access_level(): void
6969{
7070 $ user = (new UserBuilder ())->withAccessLevel (3 )->build ();
7171
72- assert (true , $ user ->canEditVideos ());
72+ assertThat (true , $ user ->canEditVideos ());
7373}
7474
7575function test_user_is_not_able_to_edit_videos_without_enough_access_level (): void
7676{
7777 $ user = (new UserBuilder ())->withAccessLevel (1 )->build ();
7878
79- assert (false , $ user ->canEditVideos ());
79+ assertThat (false , $ user ->canEditVideos ());
8080}
8181
82- function assert (bool $ expected , bool $ actual ): void
82+ function assertThat (bool $ expected , bool $ actual ): void
8383{
8484 if ($ expected !== $ actual ) {
8585 throw new Exception ('Condition not satisfied ' );
Original file line number Diff line number Diff line change @@ -4,17 +4,17 @@ function test_user_is_able_to_edit_video_with_enough_access_level(): void
44{
55 $ user = UserStub::withAccessLevel (3 );
66
7- assert (true , $ user ->canEditVideos ());
7+ assertThat (true , $ user ->canEditVideos ());
88}
99
1010function test_user_is_not_able_to_edit_videos_without_enough_access_level (): void
1111{
1212 $ user = UserStub::withAccessLevel (1 );
1313
14- assert (false , $ user ->canEditVideos ());
14+ assertThat (false , $ user ->canEditVideos ());
1515}
1616
17- function assert (bool $ expected , bool $ actual ): void
17+ function assertThat (bool $ expected , bool $ actual ): void
1818{
1919 if ($ expected !== $ actual ) {
2020 throw new Exception ('Condition not satisfied ' );
You can’t perform that action at this time.
0 commit comments