Example #1
0
 /**
  * @dataProvider tokenProvider
  */
 public function testToken($expected, $options)
 {
     $mock = new MockHandler([new Response(200, ['Content-Type' => 'text/plain'], 'KBC::Encrypted==hgAYFu8FiztDlUOJ5Bg7cxoBKwOeNTONrv8Be/vsWMif3hW9dl8uunwuNvD4+c6ME0GHHjVCwRkgFvn3lD94PQ==')]);
     // Add the history middleware to the handler stack.
     $container = [];
     $history = Middleware::history($container);
     $stack = HandlerStack::create($mock);
     $stack->push($history);
     $defaults = array_merge(['handler' => $stack], $options);
     $client = new Client($defaults);
     $client->encryptString("docker", "test");
     /** @var Request $request */
     $request = $container[0]['request'];
     $this->assertEquals($expected, $request->hasHeader("x-storageapi-token"));
 }