| @@ 67-82 (lines=16) @@ | ||
| 64 | /** |
|
| 65 | * @expectedException \RuntimeException |
|
| 66 | */ |
|
| 67 | public function testInitialisingRequestAfterResponse() |
|
| 68 | { |
|
| 69 | $container = []; |
|
| 70 | $guzzle = $this->getMockHttpClientWithHistoryAndResponses( |
|
| 71 | $container, |
|
| 72 | [$this->getMockHttpResponse('GetClassifiersSuccess.txt')] |
|
| 73 | ); |
|
| 74 | ||
| 75 | $client = new Client($guzzle); |
|
| 76 | $client->initialize(['username' => 'test', 'password' => 'test']); |
|
| 77 | ||
| 78 | $request = $client->getClassifiers(); |
|
| 79 | $request->send(); |
|
| 80 | ||
| 81 | $request->initialize(); |
|
| 82 | } |
|
| 83 | ||
| 84 | /** |
|
| 85 | * @expectedException \RuntimeException |
|
| @@ 87-102 (lines=16) @@ | ||
| 84 | /** |
|
| 85 | * @expectedException \RuntimeException |
|
| 86 | */ |
|
| 87 | public function testSetUsernameOnRequestAfterResponse() |
|
| 88 | { |
|
| 89 | $container = []; |
|
| 90 | $guzzle = $this->getMockHttpClientWithHistoryAndResponses( |
|
| 91 | $container, |
|
| 92 | [$this->getMockHttpResponse('GetClassifiersSuccess.txt')] |
|
| 93 | ); |
|
| 94 | ||
| 95 | $client = new Client($guzzle); |
|
| 96 | $client->initialize(['username' => 'test', 'password' => 'test']); |
|
| 97 | ||
| 98 | $request = $client->getClassifiers(); |
|
| 99 | $request->send(); |
|
| 100 | ||
| 101 | $request->setUsername('test2'); |
|
| 102 | } |
|
| 103 | } |
|
| 104 | ||