blob: 304ee6a19259ab449a5c172f86fb015d2b11a0c7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
<?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 EngelsystemLogger|MockObject $logger */
$logger = $this->getMockBuilder(EngelsystemLogger::class)
->disableOriginalConstructor()
->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();
}
}
|