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 7a51c61f..1aa8c5d6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,19 @@ language: php php: + - 5.5 + - 5.6 - 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: - - phpdbg -qrr ./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 038127f1..41ddf0d4 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); } /**