diff --git a/.travis.yml b/.travis.yml index 6e51088..ecdc289 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,11 +2,11 @@ sudo: false language: php php: - - 5.3 - - 5.4 - 5.5 - 5.6 + - 7.0 - 7.1 + - 7.2 cache: directories: @@ -15,3 +15,5 @@ cache: install: - composer install --prefer-dist +script: + - php vendor/bin/phpunit diff --git a/Spreadsheet/Excel/Writer/Workbook.php b/Spreadsheet/Excel/Writer/Workbook.php index 4c9e525..3c779ec 100644 --- a/Spreadsheet/Excel/Writer/Workbook.php +++ b/Spreadsheet/Excel/Writer/Workbook.php @@ -39,6 +39,10 @@ if (!class_exists('Spreadsheet_Excel_Writer_BIFFwriter')) { require_once 'Spreadsheet/Excel/Writer/Parser.php'; } +if (!class_exists('OLE')) { + require_once 'OLE.php'; +} + if (!class_exists('OLE_PPS_Root')) { require_once 'OLE/PPS/Root.php'; } diff --git a/composer.json b/composer.json index df6faed..98fc7ce 100644 --- a/composer.json +++ b/composer.json @@ -51,8 +51,8 @@ "type": "library", "require": { "pear/pear-core-minimal": "^1.10", - "pear/ole": "*", - "php": ">=5.3.3" + "pear/ole": ">=1.0.0RC3", + "php": ">=5.3.3 <7.3" }, "require-dev": { "phpunit/phpunit": "<6.0" diff --git a/test/Test/Spreadsheet/Excel/Writer/WorkbookTest.php b/test/Test/Spreadsheet/Excel/Writer/WorkbookTest.php index a7416ef..301c4c9 100644 --- a/test/Test/Spreadsheet/Excel/Writer/WorkbookTest.php +++ b/test/Test/Spreadsheet/Excel/Writer/WorkbookTest.php @@ -6,6 +6,12 @@ */ class Test_Spreadsheet_Excel_Writer_WorkbookTest extends Test_Spreadsheet_Excel_WriterTestCase { + public static function setUpBeforeClass() + { + // Preload constants from OLE + @class_exists(OLE::class); + } + public function testSetVersion() { $workbook = $this->getNewWorkbook();