@@ 64-75 (lines=12) @@ | ||
61 | $stub->setPublicationId('invalidpublicationid'); |
|
62 | } |
|
63 | ||
64 | public function testSignRequest() |
|
65 | { |
|
66 | $stub = $this->getStub(); |
|
67 | ||
68 | $client = new GuzzleHttpClient(); |
|
69 | $request = $client->createRequest('GET', 'http://www.example.org/'); |
|
70 | ||
71 | $this->invokeMethod($stub, 'signRequest', [$request]); |
|
72 | ||
73 | $this->assertNotNull($request->getHeader('X-Snd-ApiSignature')); |
|
74 | $this->assertNotNull($request->getHeader('X-Snd-ApiKey')); |
|
75 | } |
|
76 | ||
77 | public function testSignRequestWithEmptyApiKey() |
|
78 | { |
|
@@ 77-88 (lines=12) @@ | ||
74 | $this->assertNotNull($request->getHeader('X-Snd-ApiKey')); |
|
75 | } |
|
76 | ||
77 | public function testSignRequestWithEmptyApiKey() |
|
78 | { |
|
79 | $stub = $this->getStub(); |
|
80 | $stub->setApiKey(''); |
|
81 | ||
82 | $client = new GuzzleHttpClient(); |
|
83 | $request = $client->createRequest('GET', 'http://www.example.org/'); |
|
84 | ||
85 | $this->invokeMethod($stub, 'signRequest', [$request]); |
|
86 | ||
87 | $this->assertEmpty($request->getHeader('X-Snd-ApiKey')); |
|
88 | } |
|
89 | ||
90 | /** |
|
91 | * @dataProvider jsonAcceptationProvider |