@@ -34,25 +34,20 @@ final class UrlBuilderServiceTest extends TestCase
3434
3535 protected function setUp (): void
3636 {
37- parent ::setUp ();
38-
3937 $ this ->uriBuilderMock = $ this ->createMock (UriBuilder::class);
4038 GeneralUtility::setSingletonInstance (UriBuilder::class, $ this ->uriBuilderMock );
4139 }
4240
4341 protected function tearDown (): void
4442 {
4543 GeneralUtility::purgeInstances ();
46- parent ::tearDown ();
4744 }
4845
4946 #[Test]
5047 public function buildEditUrlReturnsCorrectUrl (): void
5148 {
5249 $ this ->uriBuilderMock ->method ('buildUriFromRoute ' )
53- ->with ('record_edit ' , self ::callback (static function (array $ params ): bool {
54- return isset ($ params ['edit ' ]['tt_content ' ][1 ]) && 'edit ' === $ params ['edit ' ]['tt_content ' ][1 ];
55- }))
50+ ->with ('record_edit ' , self ::callback (static fn (array $ params ): bool => isset ($ params ['edit ' ]['tt_content ' ][1 ]) && 'edit ' === $ params ['edit ' ]['tt_content ' ][1 ]))
5651 ->willReturn (new Uri ('/typo3/record/edit ' ));
5752
5853 $ service = new UrlBuilderService ();
@@ -65,9 +60,7 @@ public function buildEditUrlReturnsCorrectUrl(): void
6560 public function buildPageLayoutUrlReturnsCorrectUrl (): void
6661 {
6762 $ this ->uriBuilderMock ->method ('buildUriFromRoute ' )
68- ->with ('web_layout ' , self ::callback (static function (array $ params ): bool {
69- return 1 === $ params ['id ' ] && 0 === $ params ['language ' ];
70- }))
63+ ->with ('web_layout ' , self ::callback (static fn (array $ params ): bool => 1 === $ params ['id ' ] && 0 === $ params ['language ' ]))
7164 ->willReturn (new Uri ('/typo3/module/web/layout ' ));
7265
7366 $ service = new UrlBuilderService ();
@@ -80,9 +73,7 @@ public function buildPageLayoutUrlReturnsCorrectUrl(): void
8073 public function buildPageLayoutUrlIncludesScrollToElement (): void
8174 {
8275 $ this ->uriBuilderMock ->method ('buildUriFromRoute ' )
83- ->with ('web_layout ' , self ::callback (static function (array $ params ): bool {
84- return isset ($ params ['scrollToElement ' ]) && 42 === $ params ['scrollToElement ' ];
85- }))
76+ ->with ('web_layout ' , self ::callback (static fn (array $ params ): bool => isset ($ params ['scrollToElement ' ]) && 42 === $ params ['scrollToElement ' ]))
8677 ->willReturn (new Uri ('/typo3/module/web/layout ' ));
8778
8879 $ service = new UrlBuilderService ();
@@ -108,9 +99,7 @@ public function buildHideUrlReturnsCorrectUrl(): void
10899 public function buildInfoUrlReturnsCorrectUrl (): void
109100 {
110101 $ this ->uriBuilderMock ->method ('buildUriFromRoute ' )
111- ->with ('show_item ' , self ::callback (static function (array $ params ): bool {
112- return 1 === $ params ['uid ' ] && 'tt_content ' === $ params ['table ' ];
113- }))
102+ ->with ('show_item ' , self ::callback (static fn (array $ params ): bool => 1 === $ params ['uid ' ] && 'tt_content ' === $ params ['table ' ]))
114103 ->willReturn (new Uri ('/typo3/show_item ' ));
115104
116105 $ service = new UrlBuilderService ();
@@ -136,9 +125,7 @@ public function buildMoveUrlReturnsCorrectUrl(): void
136125 public function buildHistoryUrlReturnsCorrectUrl (): void
137126 {
138127 $ this ->uriBuilderMock ->method ('buildUriFromRoute ' )
139- ->with ('record_history ' , self ::callback (static function (array $ params ): bool {
140- return 'tt_content:1 ' === $ params ['element ' ];
141- }))
128+ ->with ('record_history ' , self ::callback (static fn (array $ params ): bool => 'tt_content:1 ' === $ params ['element ' ]))
142129 ->willReturn (new Uri ('/typo3/record_history ' ));
143130
144131 $ service = new UrlBuilderService ();
@@ -151,9 +138,7 @@ public function buildHistoryUrlReturnsCorrectUrl(): void
151138 public function buildNewContentAfterUrlReturnsCorrectUrl (): void
152139 {
153140 $ this ->uriBuilderMock ->method ('buildUriFromRoute ' )
154- ->with ('record_edit ' , self ::callback (static function (array $ params ): bool {
155- return isset ($ params ['edit ' ]['tt_content ' ][-1 ]) && 'new ' === $ params ['edit ' ]['tt_content ' ][-1 ];
156- }))
141+ ->with ('record_edit ' , self ::callback (static fn (array $ params ): bool => isset ($ params ['edit ' ]['tt_content ' ][-1 ]) && 'new ' === $ params ['edit ' ]['tt_content ' ][-1 ]))
157142 ->willReturn (new Uri ('/typo3/record/edit ' ));
158143
159144 $ service = new UrlBuilderService ();
0 commit comments