summaryrefslogtreecommitdiff
path: root/tests/Unit/Routing/RoutingServiceProviderTest.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2017-10-31 14:15:19 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2017-10-31 14:15:19 +0100
commit411ea5bb6d0ecf32e6c989a99fac120502db9fe9 (patch)
tree736b66c00b26dac8fc9cf4283d4888b0b69b9816 /tests/Unit/Routing/RoutingServiceProviderTest.php
parent915cbee3e099cc7d48f71f6627b5fde3942cbe88 (diff)
Refactored service provider tests
Diffstat (limited to 'tests/Unit/Routing/RoutingServiceProviderTest.php')
-rw-r--r--tests/Unit/Routing/RoutingServiceProviderTest.php20
1 files changed, 5 insertions, 15 deletions
diff --git a/tests/Unit/Routing/RoutingServiceProviderTest.php b/tests/Unit/Routing/RoutingServiceProviderTest.php
index 4f1cd5fc..bb2a1d65 100644
--- a/tests/Unit/Routing/RoutingServiceProviderTest.php
+++ b/tests/Unit/Routing/RoutingServiceProviderTest.php
@@ -2,13 +2,12 @@
namespace Engelsystem\Test\Routing;
-use Engelsystem\Application;
use Engelsystem\Routing\RoutingServiceProvider;
use Engelsystem\Routing\UrlGenerator;
-use PHPUnit\Framework\TestCase;
+use Engelsystem\Test\Unit\ServiceProviderTest;
use PHPUnit_Framework_MockObject_MockObject;
-class RoutingServiceProviderTest extends TestCase
+class RoutingServiceProviderTest extends ServiceProviderTest
{
/**
* @covers \Engelsystem\Routing\RoutingServiceProvider::register()
@@ -19,19 +18,10 @@ class RoutingServiceProviderTest extends TestCase
$urlGenerator = $this->getMockBuilder(UrlGenerator::class)
->getMock();
- /** @var PHPUnit_Framework_MockObject_MockObject|Application $app */
- $app = $this->getMockBuilder(Application::class)
- ->setMethods(['make', 'instance'])
- ->getMock();
-
- $app->expects($this->once())
- ->method('make')
- ->with(UrlGenerator::class)
- ->willReturn($urlGenerator);
+ $app = $this->getApp();
- $app->expects($this->once())
- ->method('instance')
- ->with('routing.urlGenerator', $urlGenerator);
+ $this->setExpects($app, 'make', [UrlGenerator::class], $urlGenerator);
+ $this->setExpects($app, 'instance', ['routing.urlGenerator', $urlGenerator]);
$serviceProvider = new RoutingServiceProvider($app);
$serviceProvider->register();