public function testReturnsEmptyPatternIfNoneMatched() { $request = $this->getMock('Symfony\\Component\\HttpFoundation\\Request'); $requestMatcher = $this->getRequestMatcher($request, false); $map = new AccessMap(); $map->add($requestMatcher, array('ROLE_USER'), 'https'); $this->assertSame(array(null, null), $map->getPatterns($request)); }
/** * {@inheritdoc} */ public function onKernelException(GetResponseForExceptionEvent $event) { $isPanel = false; foreach ($this->accessMap->getPatterns($event->getRequest()) as $pattern) { if (is_array($pattern)) { foreach ($pattern as $role) { if (is_string($role) && $role === 'ROLE_PANEL_ACCESS') { $isPanel = true; break; } } } } if ($isPanel) { $this->activeTheme->setName('backend_' . $this->backendTheme); } $this->loginBlockedException($event); }