engelsystem/tests/Unit/Routing/RoutingServiceProviderTest.php

30 lines
905 B
PHP
Raw Normal View History

2017-10-31 13:40:13 +01:00
<?php
namespace Engelsystem\Test\Unit\Routing;
2017-10-31 13:40:13 +01:00
use Engelsystem\Routing\RoutingServiceProvider;
use Engelsystem\Routing\UrlGenerator;
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;
2017-10-31 14:15:19 +01:00
class RoutingServiceProviderTest extends ServiceProviderTest
2017-10-31 13:40:13 +01:00
{
/**
* @covers \Engelsystem\Routing\RoutingServiceProvider::register()
*/
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);
$this->setExpects($app, 'instance', ['routing.urlGenerator', $urlGenerator]);
2017-10-31 13:40:13 +01:00
$serviceProvider = new RoutingServiceProvider($app);
$serviceProvider->register();
}
}