public function testBeforeDispatchWithException() { $exception = new LocalizedException(new Phrase('Phrase')); $this->themeRegistration->expects($this->once())->method('register')->willThrowException($exception); $this->logger->expects($this->once())->method('critical'); $this->plugin->beforeDispatch($this->abstractAction, $this->request); }