Skip to content

Commit

Permalink
Hopeful fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Garethp committed May 2, 2016
1 parent 93587f7 commit 8d3769a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
7 changes: 7 additions & 0 deletions .travis.sh
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
19 changes: 13 additions & 6 deletions src/API/NTLMSoapClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 8d3769a

Please sign in to comment.