From 8d3769acd45e1dba04315cae7fa34cf1813a54a0 Mon Sep 17 00:00:00 2001 From: Garethp Date: Mon, 2 May 2016 16:36:49 +0200 Subject: [PATCH] Hopeful fix --- .travis.sh | 7 +++++++ .travis.yml | 3 ++- src/API/NTLMSoapClient.php | 19 +++++++++++++------ 3 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 .travis.sh diff --git a/.travis.sh b/.travis.sh new file mode 100644 index 00000000..d020add6 --- /dev/null +++ b/.travis.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +if [[ $TRAVIS_PHP_VERSION = 7.* ]]; then + phpdbg -qrr ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml +else + ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml +fi diff --git a/.travis.yml b/.travis.yml index 4ec957e8..1aa8c5d6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,13 +6,14 @@ php: - 7.0 before_script: + - chmod a+x ./.travis.sh - composer self-update - composer install --no-ansi - wget https://scrutinizer-ci.com/ocular.phar - mkdir -p build/logs script: - - ./vendor/bin/phpunit --coverage-clover=build/logs/clover.xml + - ./.travis.sh - composer cs after_script: diff --git a/src/API/NTLMSoapClient.php b/src/API/NTLMSoapClient.php index 6aca94b7..93681e37 100644 --- a/src/API/NTLMSoapClient.php +++ b/src/API/NTLMSoapClient.php @@ -106,18 +106,25 @@ public function __call($name, $args) $args[0] = $args[0]->toXmlObject(); } - $this->__default_headers = array ( + $headers = array ( $this->ewsHeaders['version'], - $this->ewsHeaders['impersonation'] + $this->ewsHeaders['impersonation'], ); if (!in_array($name, $this->callsWithoutTimezone)) { - $this->__default_headers[] = $this->ewsHeaders['timezone']; + $headers[] = $this->ewsHeaders['timezone']; } - $response = parent::__call($name, $args); - $this->__default_headers = []; - return $response; + $headers = array_filter($headers, function ($header) { + if (!($header instanceof SoapHeader)) { + return false; + } + + return true; + }); + + $this->__setSoapHeaders($headers); + return parent::__call($name, $args); } /**