SebastiaanLuca\Router\Tests\ExtendedRouterTest::testItRegistersMiddleware PHP Method

testItRegistersMiddleware() public method

    public function testItRegistersMiddleware()
    {
        $router = $this->createExtendedRouter(false);
        // Pretend the application has fully booted and
        // allow actual registration of middleware
        $this->setValueOfInternalProperty($router, 'isBootstrapped', true);
        // Use the real method instead of mocking it
        $router->shouldReceive('registerNamedRouteMiddleware')->passthru();
        // Auto-mocked method which we're expecting to get called
        $router->shouldReceive('addMiddlewareToRoute')->with('mockedRoute', ['middleware'])->once();
        // Kick-off
        $router->registerNamedRouteMiddleware('mockedRoute', 'middleware');
    }