summaryrefslogtreecommitdiff
path: root/tests/Unit/Logger/LoggerServiceProviderTest.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/Logger/LoggerServiceProviderTest.php
parent915cbee3e099cc7d48f71f6627b5fde3942cbe88 (diff)
Refactored service provider tests
Diffstat (limited to 'tests/Unit/Logger/LoggerServiceProviderTest.php')
-rw-r--r--tests/Unit/Logger/LoggerServiceProviderTest.php20
1 files changed, 5 insertions, 15 deletions
diff --git a/tests/Unit/Logger/LoggerServiceProviderTest.php b/tests/Unit/Logger/LoggerServiceProviderTest.php
index 5143d236..66f63cf4 100644
--- a/tests/Unit/Logger/LoggerServiceProviderTest.php
+++ b/tests/Unit/Logger/LoggerServiceProviderTest.php
@@ -2,14 +2,13 @@
namespace Engelsystem\Test\Logger;
-use Engelsystem\Application;
use Engelsystem\Logger\EngelsystemLogger;
use Engelsystem\Logger\LoggerServiceProvider;
-use PHPUnit\Framework\TestCase;
+use Engelsystem\Test\Unit\ServiceProviderTest;
use PHPUnit_Framework_MockObject_MockObject;
use Psr\Log\LoggerInterface;
-class LoggerServiceProviderTest extends TestCase
+class LoggerServiceProviderTest extends ServiceProviderTest
{
/**
* @covers \Engelsystem\Logger\LoggerServiceProvider::register()
@@ -20,19 +19,10 @@ class LoggerServiceProviderTest extends TestCase
$logger = $this->getMockBuilder(EngelsystemLogger::class)
->getMock();
- /** @var PHPUnit_Framework_MockObject_MockObject|Application $app */
- $app = $this->getMockBuilder(Application::class)
- ->setMethods(['make', 'instance', 'bind'])
- ->getMock();
-
- $app->expects($this->once())
- ->method('make')
- ->with(EngelsystemLogger::class)
- ->willReturn($logger);
+ $app = $this->getApp(['make', 'instance', 'bind']);
- $app->expects($this->once())
- ->method('instance')
- ->with('logger', $logger);
+ $this->setExpects($app, 'make', [EngelsystemLogger::class], $logger);
+ $this->setExpects($app, 'instance', ['logger', $logger]);
$app->expects($this->atLeastOnce())
->method('bind')