@@ -337,8 +337,10 @@ public function display($tpl = null)
337337 };
338338 $ mvcFactory = $ this ->createStub (MVCFactoryInterface::class);
339339 $ mvcFactory ->method ('createView ' )->willReturn ($ view );
340+ $ app = $ this ->createStub (CMSApplicationInterface::class);
341+ $ app ->method ('getName ' )->willReturn ('Test ' );
340342
341- $ controller = new class (['base_path ' => __DIR__ ], $ mvcFactory , $ this -> createStub (CMSApplicationInterface::class) , new Input ()) extends BaseController {
343+ $ controller = new class (['base_path ' => __DIR__ ], $ mvcFactory , $ app , new Input ()) extends BaseController {
342344 };
343345
344346 $ this ->assertEquals ($ view , $ controller ->getView ('testGetView ' ));
@@ -407,6 +409,7 @@ public function getUser(): User
407409
408410 $ user = new User ();
409411 $ app = $ this ->createStub (CMSApplicationInterface::class);
412+ $ app ->method ('getName ' )->willReturn ('Test ' );
410413 $ app ->method ('getIdentity ' )->willReturn ($ user );
411414
412415 $ controller = new class (['base_path ' => __DIR__ ], $ mvcFactory , $ app , new Input ()) extends BaseController {
@@ -467,8 +470,11 @@ public function getPaths()
467470 */
468471 public function testDisplay ()
469472 {
473+ $ doc = $ this ->createStub (Document::class);
474+ $ doc ->method ('getType ' )->willReturn ('html ' );
470475 $ app = $ this ->createStub (CMSWebApplicationInterface::class);
471- $ app ->method ('getDocument ' )->willReturn (new Document ());
476+ $ app ->method ('getName ' )->willReturn ('Test ' );
477+ $ app ->method ('getDocument ' )->willReturn ($ doc );
472478
473479 $ view = new class (['name ' => 'test ' ]) extends AbstractView {
474480 public $ value = null ;
@@ -498,8 +504,11 @@ public function display($tpl = null)
498504 */
499505 public function testDisplayWithModel ()
500506 {
507+ $ doc = $ this ->createStub (Document::class);
508+ $ doc ->method ('getType ' )->willReturn ('html ' );
501509 $ app = $ this ->createStub (CMSWebApplicationInterface::class);
502- $ app ->method ('getDocument ' )->willReturn (new Document ());
510+ $ app ->method ('getName ' )->willReturn ('Test ' );
511+ $ app ->method ('getDocument ' )->willReturn ($ doc );
503512
504513 $ model = new class (['name ' => 'test ' ]) extends BaseModel {
505514 };
0 commit comments