engelsystem/tests/Unit/Http/UrlGeneratorServiceProvider...

35 lines
1.0 KiB
PHP
Raw Normal View History

2017-10-31 13:40:13 +01:00
<?php
namespace Engelsystem\Test\Unit\Http;
2017-10-31 13:40:13 +01:00
use Engelsystem\Http\UrlGenerator;
use Engelsystem\Http\UrlGeneratorServiceProvider;
2017-10-31 14:15:19 +01:00
use Engelsystem\Test\Unit\ServiceProviderTest;
use PHPUnit\Framework\MockObject\MockObject;
2017-10-31 13:40:13 +01:00
class UrlGeneratorServiceProviderTest extends ServiceProviderTest
2017-10-31 13:40:13 +01:00
{
/**
* @covers \Engelsystem\Http\UrlGeneratorServiceProvider::register()
2017-10-31 13:40:13 +01:00
*/
public function testRegister()
{
/** @var UrlGenerator|MockObject $urlGenerator */
2017-10-31 13:40:13 +01:00
$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-26 12:23:47 +02:00
$app->expects($this->exactly(2))
->method('instance')
->withConsecutive(
[UrlGenerator::class, $urlGenerator],
['http.urlGenerator', $urlGenerator]
);
2017-10-31 13:40:13 +01:00
$serviceProvider = new UrlGeneratorServiceProvider($app);
2017-10-31 13:40:13 +01:00
$serviceProvider->register();
}
}