/**
  * {@inheritdoc}
  */
 public function getAuthenticationTokenContext()
 {
     if (!$this->authenticationTokenResponse || $this->authenticationTokenResponse->isDeprecated()) {
         $this->authenticationTokenResponse = $this->authenticate();
     }
     return new AuthenticationTokenContext($this->authenticationRequest->getAccountId(), $this->authenticationTokenResponse->getKey());
 }
 /**
  * Tests the isDeprecated method
  */
 public function testIsDeprecated()
 {
     $token = new AuthenticationTokenResponse(new \DateTime('-1 day'), 'fake_key');
     $this->assertTrue($token->isDeprecated());
     $token = new AuthenticationTokenResponse(new \DateTime('+1 day'), 'fake_key');
     $this->assertFalse($token->isDeprecated());
 }