2017-10-31 13:40:13 +01:00
|
|
|
<?php
|
|
|
|
|
2017-10-31 14:23:23 +01:00
|
|
|
namespace Engelsystem\Test\Unit\Routing;
|
2017-10-31 13:40:13 +01:00
|
|
|
|
2018-08-22 03:10:08 +02:00
|
|
|
use Engelsystem\Http\UrlGenerator;
|
|
|
|
use Engelsystem\Http\UrlGeneratorServiceProvider;
|
2017-10-31 14:15:19 +01:00
|
|
|
use Engelsystem\Test\Unit\ServiceProviderTest;
|
2017-10-31 13:40:13 +01:00
|
|
|
use PHPUnit_Framework_MockObject_MockObject;
|
|
|
|
|
2018-08-22 03:10:08 +02:00
|
|
|
class UrlGeneratorServiceProviderTest extends ServiceProviderTest
|
2017-10-31 13:40:13 +01:00
|
|
|
{
|
|
|
|
/**
|
2018-08-22 03:10:08 +02:00
|
|
|
* @covers \Engelsystem\Http\UrlGeneratorServiceProvider::register()
|
2017-10-31 13:40:13 +01:00
|
|
|
*/
|
|
|
|
public function testRegister()
|
|
|
|
{
|
|
|
|
/** @var PHPUnit_Framework_MockObject_MockObject|UrlGenerator $urlGenerator */
|
|
|
|
$urlGenerator = $this->getMockBuilder(UrlGenerator::class)
|
|
|
|
->getMock();
|
|
|
|
|
2017-10-31 14:15:19 +01:00
|
|
|
$app = $this->getApp();
|
2017-10-31 13:40:13 +01:00
|
|
|
|
2017-10-31 14:15:19 +01:00
|
|
|
$this->setExpects($app, 'make', [UrlGenerator::class], $urlGenerator);
|
2018-08-22 03:10:08 +02:00
|
|
|
$this->setExpects($app, 'instance', ['http.urlGenerator', $urlGenerator]);
|
2017-10-31 13:40:13 +01:00
|
|
|
|
2018-08-22 03:10:08 +02:00
|
|
|
$serviceProvider = new UrlGeneratorServiceProvider($app);
|
2017-10-31 13:40:13 +01:00
|
|
|
$serviceProvider->register();
|
|
|
|
}
|
|
|
|
}
|