Skip to content

Commit 4b5eaab

Browse files
author
olaru
committed
phpunit version change
Signed-off-by: olaru <olaru@rospace.com>
1 parent 9aa5689 commit 4b5eaab

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

‎phpunit.xml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
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">

‎test/Unit/Page/Handler/PageHandlerTest.php‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff 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);

‎test/Unit/Page/RoutesDelegatorTest.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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,

0 commit comments

Comments
 (0)