diff --git a/src/PhpWord/Reader/MsDoc.php b/src/PhpWord/Reader/MsDoc.php index c63d8d9e22..92b00392b5 100644 --- a/src/PhpWord/Reader/MsDoc.php +++ b/src/PhpWord/Reader/MsDoc.php @@ -141,7 +141,7 @@ private function loadOLE($filename) // Get Summary Information data $this->_SummaryInformation = $ole->getStream($ole->summaryInformation); // Get Document Summary Information data - $this->_DocumentSummaryInformation = $ole->getStream($ole->documentSummaryInformation); + $this->_DocumentSummaryInformation = $ole->getStream($ole->docSummaryInfos); } private function getNumInLcb($lcb, $iSize) diff --git a/tests/PhpWord/Tests/Reader/MsDocTest.php b/tests/PhpWord/Tests/Reader/MsDocTest.php new file mode 100644 index 0000000000..593c64fd01 --- /dev/null +++ b/tests/PhpWord/Tests/Reader/MsDocTest.php @@ -0,0 +1,60 @@ +assertTrue($object->canRead($filename)); + } + + /** + * Can read exception + */ + public function testCanReadFailed() + { + $object = new MsDoc(); + $filename = __DIR__ . '/../_files/documents/foo.doc'; + $this->assertFalse($object->canRead($filename)); + } + + /** + * Load + */ + public function testLoad() + { + $filename = __DIR__ . '/../_files/documents/reader.doc'; + $phpWord = IOFactory::load($filename, 'MsDoc'); + $this->assertInstanceOf('PhpOffice\\PhpWord\\PhpWord', $phpWord); + } +} diff --git a/tests/PhpWord/Tests/_files/documents/reader.doc b/tests/PhpWord/Tests/_files/documents/reader.doc new file mode 100644 index 0000000000..4e92b2deb2 Binary files /dev/null and b/tests/PhpWord/Tests/_files/documents/reader.doc differ