summaryrefslogtreecommitdiff
path: root/tests/Unit/Routing/RoutingServiceProviderTest.php
blob: bb2a1d65fcc9a596e198a1ac46b831e64a7103ee (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
<?php

namespace Engelsystem\Test\Routing;

use Engelsystem\Routing\RoutingServiceProvider;
use Engelsystem\Routing\UrlGenerator;
use Engelsystem\Test\Unit\ServiceProviderTest;
use PHPUnit_Framework_MockObject_MockObject;

class RoutingServiceProviderTest extends ServiceProviderTest
{
    /**
     * @covers \Engelsystem\Routing\RoutingServiceProvider::register()
     */
    public function testRegister()
    {
        /** @var PHPUnit_Framework_MockObject_MockObject|UrlGenerator $urlGenerator */
        $urlGenerator = $this->getMockBuilder(UrlGenerator::class)
            ->getMock();

        $app = $this->getApp();

        $this->setExpects($app, 'make', [UrlGenerator::class], $urlGenerator);
        $this->setExpects($app, 'instance', ['routing.urlGenerator', $urlGenerator]);

        $serviceProvider = new RoutingServiceProvider($app);
        $serviceProvider->register();
    }
}