/** * @param string $jsonData * * @throws TokenException * * @return Token */ private function createToken($jsonData) { $content = json_decode($jsonData, true); if (!is_array($content)) { throw new TokenException(sprintf('Could not decode JSON string: "%s"', $jsonData)); } return Token::create($content); }
/** * @test * @@dataProvider invalidFactoryMethodDataProvider * @expectedException \TreeHouse\Keystone\Client\Exception\TokenException * * @param array $content */ public function it_cannot_be_constructed_with_invalid_arguments(array $content) { Token::create($content); }