summaryrefslogtreecommitdiff
path: root/tests/Unit/Logger/LoggerServiceProviderTest.php
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2017-11-12 13:25:56 +0100
committerGitHub <noreply@github.com>2017-11-12 13:25:56 +0100
commitebc973bf221bfbde327868975221e62704e4cb99 (patch)
tree9011a160f3d6f9cae37fc02836e7d6e8c25242ca /tests/Unit/Logger/LoggerServiceProviderTest.php
parent801c17aa6cef91be988a25a90442be8d2078a70d (diff)
parentad948bdd3201e922b626a736b0122533bdd37cae (diff)
Merge pull request #349 from MyIgel/master
Changed container to Illuminate/Container and added service providers
Diffstat (limited to 'tests/Unit/Logger/LoggerServiceProviderTest.php')
-rw-r--r--tests/Unit/Logger/LoggerServiceProviderTest.php37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/Unit/Logger/LoggerServiceProviderTest.php b/tests/Unit/Logger/LoggerServiceProviderTest.php
new file mode 100644
index 00000000..cef95d5b
--- /dev/null
+++ b/tests/Unit/Logger/LoggerServiceProviderTest.php
@@ -0,0 +1,37 @@
+<?php
+
+namespace Engelsystem\Test\Unit\Logger;
+
+use Engelsystem\Logger\EngelsystemLogger;
+use Engelsystem\Logger\LoggerServiceProvider;
+use Engelsystem\Test\Unit\ServiceProviderTest;
+use PHPUnit_Framework_MockObject_MockObject;
+use Psr\Log\LoggerInterface;
+
+class LoggerServiceProviderTest extends ServiceProviderTest
+{
+ /**
+ * @covers \Engelsystem\Logger\LoggerServiceProvider::register()
+ */
+ public function testRegister()
+ {
+ /** @var PHPUnit_Framework_MockObject_MockObject|EngelsystemLogger $logger */
+ $logger = $this->getMockBuilder(EngelsystemLogger::class)
+ ->getMock();
+
+ $app = $this->getApp(['make', 'instance', 'bind']);
+
+ $this->setExpects($app, 'make', [EngelsystemLogger::class], $logger);
+ $this->setExpects($app, 'instance', ['logger', $logger]);
+
+ $app->expects($this->atLeastOnce())
+ ->method('bind')
+ ->withConsecutive(
+ [LoggerInterface::class, 'logger'],
+ [EngelsystemLogger::class, 'logger']
+ );
+
+ $serviceProvider = new LoggerServiceProvider($app);
+ $serviceProvider->register();
+ }
+}