/** * Test nameOfMessage method. */ public function testNameOfMessage() { $this->given($cause = new \Exception('some cause'))->when($exception = NotFoundException::nameOfMessage('foo', $cause))->then()->object($exception)->isInstanceOf(NotFoundException::class)->integer($exception->getCode())->isEqualTo(0)->object($exception->getPrevious())->isIdenticalTo($cause); }
/** * @param MessageInterface $message * * @return NotFoundException */ protected function notFoundException($message) { return NotFoundException::nameOfMessage($message); }