public function testGetToken()
 {
     $xml = file_get_contents(__DIR__ . '/samples/token.xml');
     $response = new Response('200', null, $xml);
     $this->apiMock->addResponse($response);
     $token = $this->fetcher->getAccessToken('0005548e3bfe0a47938fd5b1c8369ff1');
     $correctToken = new Token('0005548e3bfe0a47938fd5b1c8369ff1', '0943093409903409023092439023', new User('11a9e9b8-c71c-4850-ab93-f14a10ca9e47', 'Test user', '*****@*****.**'), new Consumer('d454b97f34c14dac0430ea1bd3f16d45', '0943093409903409023092439023', 'UiTDatabank'));
     $this->assertEquals($correctToken, $token);
 }
 public function execute(InputInterface $input, OutputInterface $output)
 {
     parent::execute($input, $output);
     $baseUrl = $this->resolveBaseUrl('auth', $input);
     $consumerCredentials = $this->session->getConsumerCredentials();
     $fetcher = new UitidCredentialsFetcher($baseUrl, $consumerCredentials);
     $tokenKey = $input->getArgument('token');
     $token = $fetcher->getAccessToken($tokenKey);
     $output->writeln('token: ' . $token->getToken());
     $output->writeln('token secret: ' . $token->getTokenSecret());
     $output->writeln('consumer key: ' . $token->getConsumer()->getKey());
     $output->writeln('consumer name: ' . $token->getConsumer()->getName());
     $output->writeln('consumer secret: ' . $token->getConsumer()->getSecret());
     $output->writeln('user uid: ' . $token->getUser()->getUid());
     $output->writeln('user nick: ' . $token->getUser()->getNick());
     $output->writeln('user email: ' . $token->getUser()->getEmail());
 }