PHPUnit テストでGuzzle MockPluginを使用する。私が何をしても、応答コンテンツの本文がnullであることがわかりました。
私は何か間違ったことをしていますか、それともバグですか?
テスト設定
$client = new Client();
$plugin = new MockPlugin();
$plugin->addResponse(new Response(200, null, "This is never sent..."));
$client->addSubscriber($plugin);
$this->httpClientFactoryMock
->expects($this->any())
->method('getClient')
->will($this->returnValue($client));
テスト中のメソッド
$client = $this->httpClientFactory->getClient();
$request = $client->post($this->url, null, $content->asXML());
$response = $request->send();
$response->body
どこにもありません"This is never sent..."
:(ただし、ヘッダーに何かを入れることはできるので、少なくともある程度はプラグインが機能していると確信しています。