示例#1
0
 /**
  * MxToolbox constructor.
  * @param ApiToken|null $apiToken
  * @param $secure
  */
 public function __construct(ApiToken $apiToken, bool $secure = true)
 {
     $this->apiToken = $apiToken;
     $this->httpClient = new Client(['base_uri' => $this->getURL($secure), 'headers' => ['Authorization' => $this->apiToken->get()]]);
     $this->buildAnnotationRegistry();
     $this->serializer = $serializer = SerializerBuilder::create()->build();
 }
示例#2
0
 public function testApiKeyIsString()
 {
     // Arrange
     $token = new ApiToken('test-token');
     // Act
     $tokenValue = $token->get();
     // Assert
     $this->assertTrue(is_string($tokenValue));
 }