2018-10-08 19:30:37 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Engelsystem\Test\Unit\Helpers;
|
|
|
|
|
|
|
|
use Engelsystem\Application;
|
|
|
|
use Engelsystem\Helpers\Authenticator;
|
|
|
|
use Engelsystem\Helpers\AuthenticatorServiceProvider;
|
2018-10-11 01:26:34 +02:00
|
|
|
use Engelsystem\Http\Request;
|
2018-10-08 19:30:37 +02:00
|
|
|
use Engelsystem\Test\Unit\ServiceProviderTest;
|
2018-10-11 01:26:34 +02:00
|
|
|
use Psr\Http\Message\ServerRequestInterface;
|
2018-10-08 19:30:37 +02:00
|
|
|
|
|
|
|
class AuthenticatorServiceProviderTest extends ServiceProviderTest
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @covers \Engelsystem\Helpers\AuthenticatorServiceProvider::register()
|
|
|
|
*/
|
|
|
|
public function testRegister()
|
|
|
|
{
|
|
|
|
$app = new Application();
|
2018-10-11 01:26:34 +02:00
|
|
|
$app->bind(ServerRequestInterface::class, Request::class);
|
2018-10-08 19:30:37 +02:00
|
|
|
|
|
|
|
$serviceProvider = new AuthenticatorServiceProvider($app);
|
|
|
|
$serviceProvider->register();
|
|
|
|
|
|
|
|
$this->assertInstanceOf(Authenticator::class, $app->get(Authenticator::class));
|
|
|
|
$this->assertInstanceOf(Authenticator::class, $app->get('authenticator'));
|
|
|
|
}
|
|
|
|
}
|