/** * @test */ public function testInvalidUser() { $exception = MessageParserException::invalidUser(\Mockery::mock(ParsingUser::class)); $this->assertEquals(MessageParserException::INVALID_USER, $exception->getCodeName()); }
/** * @param ParsingUser $user * * @throws MessageParserException */ protected function checkUser(ParsingUser $user) { if (!$user->isDefined()) { throw MessageParserException::invalidUser($user); } }