Skip to content

Commit

Permalink
Merge pull request #65 from samsonasik/update-to-latest-phpunit-10-sy…
Browse files Browse the repository at this point in the history
…ntax

Update to use PHPUnit 10 syntax
  • Loading branch information
gsteel authored Nov 5, 2024
2 parents 9e0e36a + 0ab47a5 commit c7c53e7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
4 changes: 4 additions & 0 deletions test/Page/MvcTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
10 changes: 4 additions & 6 deletions test/Service/AbstractNavigationFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
*/
class AbstractNavigationFactoryTest extends TestCase
{
private TestAsset\TestNavigationFactory $factory;

public function setUp(): void
{
$this->factory = new TestAsset\TestNavigationFactory();
Expand Down Expand Up @@ -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')
Expand Down
5 changes: 5 additions & 0 deletions test/ServiceFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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.
*/
Expand Down

0 comments on commit c7c53e7

Please sign in to comment.