Use: throw new UnauthorizedException( 'content', 'read', array( 'contentId' => 42 ) );
Inheritance: extends eZ\Publish\API\Repository\Exceptions\UnauthorizedException, implements eZ\Publish\Core\Base\Exceptions\Httpable, implements eZ\Publish\Core\Base\Translatable, use trait eZ\Publish\Core\Base\TranslatableBase
 public function testUnauthorizedException()
 {
     $messageTemplate = 'some message template';
     $translationParams = ['some' => 'thing'];
     $exception = new UnauthorizedException('foo', 'bar');
     $exception->setMessageTemplate($messageTemplate);
     $exception->setParameters($translationParams);
     $event = $this->generateExceptionEvent($exception);
     $translatedMessage = 'translated message';
     $this->translator->expects($this->once())->method('trans')->with($messageTemplate, $translationParams)->willReturn($translatedMessage);
     $this->listener->onKernelException($event);
     $convertedException = $event->getException();
     self::assertInstanceOf('\\Symfony\\Component\\Security\\Core\\Exception\\AccessDeniedException', $convertedException);
     self::assertSame($exception, $convertedException->getPrevious());
     self::assertSame($translatedMessage, $convertedException->getMessage());
 }