File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 xsi : noNamespaceSchemaLocation =" vendor/phpunit/phpunit/phpunit.xsd"
44 bootstrap =" vendor/autoload.php"
55 colors =" true"
6+ displayDetailsOnPhpunitNotices =" true"
7+ displayDetailsOnTestsThatTriggerDeprecations =" true"
8+ displayDetailsOnPhpunitDeprecations =" true"
69 stopOnError =" true" >
710 <testsuites >
811 <testsuite name =" UnitTests" >
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ class PageHandlerTest extends TestCase
2020 */
2121 public function testWillInstantiate (): void
2222 {
23- $ handler = $ this ->createMock (GetPageViewHandler::class);
23+ $ handler = $ this ->createStub (GetPageViewHandler::class);
2424
2525 $ this ->assertContainsOnlyInstancesOf (RequestHandlerInterface::class, [$ handler ]);
2626 }
@@ -31,22 +31,20 @@ public function testWillInstantiate(): void
3131 public function testHandle (): void
3232 {
3333 $ routeName = 'test_route_name ' ;
34- $ request = $ this ->createMock (ServerRequestInterface::class);
35- $ template = $ this ->createMock (TemplateRendererInterface::class);
36- $ routeResult = $ this ->createMock (RouteResult::class);
34+ $ request = $ this ->createStub (ServerRequestInterface::class);
35+ $ template = $ this ->createStub (TemplateRendererInterface::class);
36+ $ routeResult = $ this ->createStub (RouteResult::class);
3737
3838 $ routeResult
3939 ->method ('getMatchedRouteName ' )
4040 ->willReturn ($ routeName );
4141
4242 $ request
4343 ->method ('getAttribute ' )
44- ->with (RouteResult::class)
4544 ->willReturn ($ routeResult );
4645
4746 $ template
4847 ->method ('render ' )
49- ->with ($ routeName )
5048 ->willReturn ('<p> ' . $ routeName . '</p> ' );
5149
5250 $ handler = new GetPageViewHandler ($ template );
Original file line number Diff line number Diff line change @@ -30,10 +30,10 @@ public function testWillInvoke(): void
3030 $ routeUri = sprintf ('/%s/%s ' , $ moduleName , $ routeName );
3131 $ templateName = sprintf ('%s::%s ' , $ moduleName , $ routeName );
3232
33- $ container = $ this ->createMock (ContainerInterface::class);
33+ $ container = $ this ->createStub (ContainerInterface::class);
3434 $ app = $ this ->createMock (Application::class);
3535
36- $ app ->method ('get ' )->willReturn ($ this ->createMock (Route::class));
36+ $ app ->method ('get ' )->willReturn ($ this ->createStub (Route::class));
3737 $ app
3838 ->expects ($ this ->exactly (1 ))
3939 ->method ('get ' )
@@ -43,7 +43,7 @@ public function testWillInvoke(): void
4343 $ this ->assertSame ($ templateName , $ args [2 ]);
4444 });
4545
46- $ container ->method ('get ' )->with ( ' config ' )-> willReturn ([
46+ $ container ->method ('get ' )->willReturn ([
4747 'routes ' => [
4848 $ moduleName => [
4949 $ routeName => $ routeName ,
You can’t perform that action at this time.
0 commit comments