Conditions | 1 |
Paths | 1 |
Total Lines | 40 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php declare(strict_types = 1); |
||
14 | public function testSend(): void |
||
15 | { |
||
16 | $requestData = 'fooData'; |
||
17 | $responseData = 'responseData'; |
||
18 | $location = 'https://pg.eet.cz'; |
||
19 | $soapAction = 'fooAction'; |
||
20 | |||
21 | $guzzleHttpClient = $this->createMock(Client::class); |
||
22 | $guzzleHttpClient |
||
23 | ->expects(self::once()) |
||
24 | ->method('send') |
||
25 | ->with(self::callback(function (Request $request) use ($requestData, $location, $soapAction) { |
||
26 | $this->assertEquals([ |
||
27 | 'Host' => [ |
||
28 | 'pg.eet.cz', |
||
29 | ], |
||
30 | 'User-Agent' => [ |
||
31 | GuzzleSoapClientDriver::HEADER_USER_AGENT, |
||
32 | ], |
||
33 | 'Content-Type' => [ |
||
34 | 'text/xml; charset=utf-8', |
||
35 | ], |
||
36 | 'SOAPAction' => [ |
||
37 | $soapAction, |
||
38 | ], |
||
39 | 'Content-Length' => [ |
||
40 | strlen($requestData), |
||
41 | ], |
||
42 | ], $request->getHeaders()); |
||
43 | $this->assertEquals($location, (string) $request->getUri()); |
||
44 | |||
45 | return true; |
||
46 | })) |
||
47 | ->willReturn(new Response(200, [], $responseData)); |
||
48 | |||
49 | $guzzleSoapClientDriver = new GuzzleSoapClientDriver($guzzleHttpClient); |
||
|
|||
50 | $response = $guzzleSoapClientDriver->send($requestData, $location, $soapAction, SOAP_1_1); |
||
51 | |||
52 | $this->assertSame($responseData, $response); |
||
53 | } |
||
54 | |||
56 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: