File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ public function getUrl(string $viewBasePath):string {
6262 continue ;
6363 }
6464
65- break ;
65+ break ( 2 ) ;
6666 }
6767 }
6868
Original file line number Diff line number Diff line change @@ -59,16 +59,25 @@ public function testGet_noKey_shouldReturnDeepest():void {
5959 }
6060
6161 public function testGetUrl ():void {
62- $ assembly = self ::createMock (Assembly::class);
63- $ assembly ->method ("current " )
62+ $ viewAssembly = self ::createMock (Assembly::class);
63+ $ viewAssembly ->method ("current " )
6464 ->willReturnOnConsecutiveCalls (
6565 "page/_header.html " ,
6666 "page/_footer.html " ,
6767 "page/shop/@category/@itemName.html " ,
6868 );
69- $ assembly ->method ("valid " )
69+ $ viewAssembly ->method ("valid " )
7070 ->willReturn (true );
71- $ sut = new DynamicPath ("/shop/OnePlus/6T " , $ assembly );
71+ $ logicAssembly = self ::createMock (Assembly::class);
72+ $ logicAssembly ->method ("current " )
73+ ->willReturnOnConsecutiveCalls (
74+ "page/_common.php " ,
75+ "page/shop/_common.php " ,
76+ "page/shop/@category/@itemName.php " ,
77+ );
78+ $ logicAssembly ->method ("valid " )
79+ ->willReturn (true );
80+ $ sut = new DynamicPath ("/shop/OnePlus/6T " , $ viewAssembly , $ logicAssembly );
7281 self ::assertSame ("/shop/@category/@itemName " , $ sut ->getUrl ("page/ " ));
7382 }
7483}
You can’t perform that action at this time.
0 commit comments