/** * {@inheritDoc} * * @param Identificator $details * * @throws InvalidArgumentException if $details is not instance of Identificator * * @return void */ public function setDetails($details) { if (false == $details instanceof Identificator) { throw new InvalidArgumentException('Details must be instance of `Identificator`.'); } parent::setDetails($details); }
/** * @test */ public function shouldAllowGetIdentificatorPreviouslySetAsDetails() { $expectedIdentificator = new Identificator('anId', 'stdClass'); $token = new Token(); $token->setDetails($expectedIdentificator); $this->assertSame($expectedIdentificator, $token->getDetails()); }