From 689e52e592f9def4ee477016c8e09203e55a8583 Mon Sep 17 00:00:00 2001 From: Toon Verwerft Date: Sun, 8 Jan 2017 08:19:36 +0100 Subject: [PATCH] Add general user-agent headerline for guzzle integration testing --- .travis.yml | 1 + .../SoapClient/Integration/Soap/GuzzleSoapClientTest.php | 3 ++- test/fixtures/vcr/guzzle-get-city-weather-by-zip-10013.yml | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 28d695c6..9331fd16 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,7 @@ before_install: install: - if [ "$DEPENDENCIES" != "low" ]; then travis_retry composer update --no-progress --profile --prefer-dist --no-scripts --no-interaction; fi; - if [ "$DEPENDENCIES" == "low" ]; then travis_retry composer update --no-progress --profile --prefer-lowest --no-scripts --no-interaction; fi; + - composer show script: - ./vendor/bin/grumphp run diff --git a/test/PhproTest/SoapClient/Integration/Soap/GuzzleSoapClientTest.php b/test/PhproTest/SoapClient/Integration/Soap/GuzzleSoapClientTest.php index 78e25adf..17026eb0 100644 --- a/test/PhproTest/SoapClient/Integration/Soap/GuzzleSoapClientTest.php +++ b/test/PhproTest/SoapClient/Integration/Soap/GuzzleSoapClientTest.php @@ -36,8 +36,9 @@ class GuzzleSoapClientTest extends \PHPUnit_Framework_TestCase */ function setUp() { + $guzzleClient = new Client(['headers' => ['User-Agent' => 'testing/1.0']]); $this->client = new PhproSoapClient(self::CDYNE_WSDL, ['soap_version' => SOAP_1_2]); - $this->client->setHandler(GuzzleHandle::createForClient($guzzleClient = new Client())); + $this->client->setHandler(GuzzleHandle::createForClient($guzzleClient)); $this->handlerStack = $guzzleClient->getConfig('handler'); } diff --git a/test/fixtures/vcr/guzzle-get-city-weather-by-zip-10013.yml b/test/fixtures/vcr/guzzle-get-city-weather-by-zip-10013.yml index 169d4674..ca7aa89e 100644 --- a/test/fixtures/vcr/guzzle-get-city-weather-by-zip-10013.yml +++ b/test/fixtures/vcr/guzzle-get-city-weather-by-zip-10013.yml @@ -7,7 +7,7 @@ Host: wsf.cdyne.com Expect: null Accept-Encoding: null - User-Agent: 'GuzzleHttp/6.2.1 curl/7.37.1 PHP/7.1.0' + User-Agent: 'testing/1.0' Content-Type: 'application/soap+xml; charset="utf-8"; action="http://ws.cdyne.com/WeatherWS/GetCityWeatherByZIP"' Accept: null body: "\n10013\n"