From 0c5588842e0c77b7565084fa3ec43ce871e2da9c Mon Sep 17 00:00:00 2001 From: Dawid 'DeyV' Polak Date: Tue, 11 May 2021 10:11:09 +0200 Subject: [PATCH 1/2] Fix #213 - Function libxml_disable_entity_loader() is deprecated in php8 --- src/API/ExchangeWebServices.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/API/ExchangeWebServices.php b/src/API/ExchangeWebServices.php index ce76886f..d54f0d77 100644 --- a/src/API/ExchangeWebServices.php +++ b/src/API/ExchangeWebServices.php @@ -277,14 +277,20 @@ protected function createClient($server, $auth, $options) $this->server = $server; $this->version = $options['version']; - $backup = libxml_disable_entity_loader(false); + if (version_compare(PHP_VERSION, '8', '<')) { + $backup = libxml_disable_entity_loader(false); + } + $this->soap = new NTLMSoapClient( $location, $auth, dirname(__FILE__) . '/../../Resources/wsdl/services.wsdl', $options ); - libxml_disable_entity_loader($backup); + + if (version_compare(PHP_VERSION, '8', '<')) { + libxml_disable_entity_loader($backup); + } if (isset($options['primarySmtpEmailAddress'])) { $this->setPrimarySmtpEmailAddress($options['primarySmtpEmailAddress']); From 6effbe17e1f82060e99f60e11c2f70b0dbe880f2 Mon Sep 17 00:00:00 2001 From: Dawid 'DeyV' Polak Date: Tue, 11 May 2021 10:14:34 +0200 Subject: [PATCH 2/2] php8 compatibility - Composer packages and test update --- .travis.yml | 1 + ...n => CalendarTest.testDeleteCalendarItem.json} | 0 ...json => CalendarTest.testGetCalendarItem.json} | 0 ...son => CalendarTest.testGetCalendarItems.json} | 0 ...ges.json => CalendarTest.testListChanges.json} | 0 ...ar.json => CalendarTest.testPickCalendar.json} | 0 ...n => CalendarTest.testUpdateCalendarItem.json} | 0 composer.json | 6 +++--- phpunit.xml | 15 --------------- tests/src/Calendar/CalendarTest.php | 2 +- 10 files changed, 5 insertions(+), 19 deletions(-) rename Resources/recordings/garethp/ews/Test/Calendar/{APITest.testDeleteCalendarItem.json => CalendarTest.testDeleteCalendarItem.json} (100%) rename Resources/recordings/garethp/ews/Test/Calendar/{APITest.testGetCalendarItem.json => CalendarTest.testGetCalendarItem.json} (100%) rename Resources/recordings/garethp/ews/Test/Calendar/{APITest.testGetCalendarItems.json => CalendarTest.testGetCalendarItems.json} (100%) rename Resources/recordings/garethp/ews/Test/Calendar/{APITest.testListChanges.json => CalendarTest.testListChanges.json} (100%) rename Resources/recordings/garethp/ews/Test/Calendar/{APITest.testPickCalendar.json => CalendarTest.testPickCalendar.json} (100%) rename Resources/recordings/garethp/ews/Test/Calendar/{APITest.testUpdateCalendarItem.json => CalendarTest.testUpdateCalendarItem.json} (100%) diff --git a/.travis.yml b/.travis.yml index 9eadbad3..e552fe84 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ php: - 5.5 - 5.6 - 7.0 + - 8.0 before_script: - chmod a+x ./.travis.sh diff --git a/Resources/recordings/garethp/ews/Test/Calendar/APITest.testDeleteCalendarItem.json b/Resources/recordings/garethp/ews/Test/Calendar/CalendarTest.testDeleteCalendarItem.json similarity index 100% rename from Resources/recordings/garethp/ews/Test/Calendar/APITest.testDeleteCalendarItem.json rename to Resources/recordings/garethp/ews/Test/Calendar/CalendarTest.testDeleteCalendarItem.json diff --git a/Resources/recordings/garethp/ews/Test/Calendar/APITest.testGetCalendarItem.json b/Resources/recordings/garethp/ews/Test/Calendar/CalendarTest.testGetCalendarItem.json similarity index 100% rename from Resources/recordings/garethp/ews/Test/Calendar/APITest.testGetCalendarItem.json rename to Resources/recordings/garethp/ews/Test/Calendar/CalendarTest.testGetCalendarItem.json diff --git a/Resources/recordings/garethp/ews/Test/Calendar/APITest.testGetCalendarItems.json b/Resources/recordings/garethp/ews/Test/Calendar/CalendarTest.testGetCalendarItems.json similarity index 100% rename from Resources/recordings/garethp/ews/Test/Calendar/APITest.testGetCalendarItems.json rename to Resources/recordings/garethp/ews/Test/Calendar/CalendarTest.testGetCalendarItems.json diff --git a/Resources/recordings/garethp/ews/Test/Calendar/APITest.testListChanges.json b/Resources/recordings/garethp/ews/Test/Calendar/CalendarTest.testListChanges.json similarity index 100% rename from Resources/recordings/garethp/ews/Test/Calendar/APITest.testListChanges.json rename to Resources/recordings/garethp/ews/Test/Calendar/CalendarTest.testListChanges.json diff --git a/Resources/recordings/garethp/ews/Test/Calendar/APITest.testPickCalendar.json b/Resources/recordings/garethp/ews/Test/Calendar/CalendarTest.testPickCalendar.json similarity index 100% rename from Resources/recordings/garethp/ews/Test/Calendar/APITest.testPickCalendar.json rename to Resources/recordings/garethp/ews/Test/Calendar/CalendarTest.testPickCalendar.json diff --git a/Resources/recordings/garethp/ews/Test/Calendar/APITest.testUpdateCalendarItem.json b/Resources/recordings/garethp/ews/Test/Calendar/CalendarTest.testUpdateCalendarItem.json similarity index 100% rename from Resources/recordings/garethp/ews/Test/Calendar/APITest.testUpdateCalendarItem.json rename to Resources/recordings/garethp/ews/Test/Calendar/CalendarTest.testUpdateCalendarItem.json diff --git a/composer.json b/composer.json index a852f2f8..4c340de3 100644 --- a/composer.json +++ b/composer.json @@ -30,8 +30,8 @@ "require-dev": { "phpunit/phpunit": "~9.5", "squizlabs/php_codesniffer": "~3.6.0", - "mockery/mockery": "~0.9.4", - "goetas/xsd2php": "2.*@dev", - "goetas/xsd-reader": "2.*@dev" + "mockery/mockery": "^1.4", + "goetas/xsd2php": "^2.1", + "goetas/xsd-reader": "^2.0-dev" } } diff --git a/phpunit.xml b/phpunit.xml index b48587a8..bcb08d1f 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -11,19 +11,4 @@ tests/ - - - src/ - - Type - Enumeration - - - - tests - vendor - src/Type - src/Enumeration - - diff --git a/tests/src/Calendar/CalendarTest.php b/tests/src/Calendar/CalendarTest.php index e4242a73..7ad262d5 100644 --- a/tests/src/Calendar/CalendarTest.php +++ b/tests/src/Calendar/CalendarTest.php @@ -4,7 +4,7 @@ use garethp\ews\Test\BaseTestCase; -class APITest extends BaseTestCase +class CalendarTest extends BaseTestCase { public function setUp(): void {