diff --git a/test/Page/MvcTest.php b/test/Page/MvcTest.php index 4c9e2bc..d533de3 100644 --- a/test/Page/MvcTest.php +++ b/test/Page/MvcTest.php @@ -28,6 +28,10 @@ */ class MvcTest extends TestCase { + private RegexRoute $route; + private TreeRouteStack $router; + private RouteMatch $routeMatch; + protected function setUp(): void { $this->route = new RegexRoute( diff --git a/test/Service/AbstractNavigationFactoryTest.php b/test/Service/AbstractNavigationFactoryTest.php index ec9e57b..76913d7 100644 --- a/test/Service/AbstractNavigationFactoryTest.php +++ b/test/Service/AbstractNavigationFactoryTest.php @@ -23,6 +23,8 @@ */ class AbstractNavigationFactoryTest extends TestCase { + private TestAsset\TestNavigationFactory $factory; + public function setUp(): void { $this->factory = new TestAsset\TestNavigationFactory(); @@ -54,17 +56,13 @@ public function testCanCreateNavigationInstanceV2() $mvcEventStub->setRouteMatch(new Router\RouteMatch([])); $mvcEventStub->setRouter(new Router\Http\TreeRouteStack()); - $applicationMock = $this->getMockBuilder(Application::class) - ->disableOriginalConstructor() - ->getMock(); + $applicationMock = $this->createMock(Application::class); $applicationMock->expects($this->any()) ->method('getMvcEvent') ->willReturn($mvcEventStub); - $serviceManagerMock = $this->getMockBuilder(ServiceManager::class) - ->disableOriginalConstructor() - ->getMock(); + $serviceManagerMock = $this->createMock(ServiceManager::class); $serviceManagerMock->expects($this->any()) ->method('get') diff --git a/test/ServiceFactoryTest.php b/test/ServiceFactoryTest.php index f4af539..7adc941 100644 --- a/test/ServiceFactoryTest.php +++ b/test/ServiceFactoryTest.php @@ -16,6 +16,7 @@ use Laminas\Router\RouteMatch; use Laminas\Router\RouteStackInterface; use Laminas\ServiceManager\ServiceManager; +use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; @@ -29,6 +30,10 @@ class ServiceFactoryTest extends TestCase /** @var ServiceManager */ protected $serviceManager; + private MockObject $router; + private MockObject $request; + private MvcEvent $mvcEvent; + /** * Prepares the environment before running a test. */