@@ 104-122 (lines=19) @@ | ||
101 | * @test |
|
102 | * @expectedException \GuzzleHttp\Exception\RequestException |
|
103 | */ |
|
104 | public function magicCallResponseNotReceived() |
|
105 | { |
|
106 | $this->deferredHttpBinding = new FulfilledPromise($this->httpBindingMock); |
|
107 | ||
108 | $this->httpBindingMock->method('request') |
|
109 | ->willReturn( |
|
110 | new Request('POST', 'www.endpoint.com') |
|
111 | ) |
|
112 | ->with( |
|
113 | 'someSoapMethod', [['some-key' => 'some-value']] |
|
114 | ); |
|
115 | ||
116 | $this->httpBindingMock->expects($this->never())->method('response'); |
|
117 | ||
118 | $this->handlerMock->append(GuzzleRequestException::create(new Request('POST', 'www.endpoint.com'))); |
|
119 | ||
120 | $client = new SoapClient($this->clientMock, $this->deferredHttpBinding); |
|
121 | $client->someSoapMethod(['some-key' => 'some-value'])->wait(); |
|
122 | } |
|
123 | ||
124 | /** |
|
125 | * @test |
|
@@ 128-147 (lines=20) @@ | ||
125 | * @test |
|
126 | * @expectedException \Exception |
|
127 | */ |
|
128 | public function magicCallUndefinedResponse() |
|
129 | { |
|
130 | $this->deferredHttpBinding = new FulfilledPromise($this->httpBindingMock); |
|
131 | ||
132 | $this->httpBindingMock->method('request') |
|
133 | ->willReturn( |
|
134 | new Request('POST', 'www.endpoint.com') |
|
135 | ) |
|
136 | ->with( |
|
137 | 'someSoapMethod', [['some-key' => 'some-value']] |
|
138 | ); |
|
139 | ||
140 | $this->httpBindingMock->expects($this->never())->method('response'); |
|
141 | ||
142 | $this->handlerMock->append(new \Exception()); |
|
143 | ||
144 | $client = new SoapClient($this->clientMock, $this->deferredHttpBinding); |
|
145 | $client->someSoapMethod(['some-key' => 'some-value'])->wait(); |
|
146 | ||
147 | } |
|
148 | ||
149 | /** |
|
150 | * @test |