assertTrue($object->canRead($filename)); } /** * Can read exception */ public function testCanReadFailed() { $object = new Word2007(); $filename = __DIR__ . '/../_files/documents/foo.docx'; $this->assertFalse($object->canRead($filename)); } /** * Load */ public function testLoad() { $filename = __DIR__ . '/../_files/documents/reader.docx'; $phpWord = IOFactory::load($filename); $this->assertInstanceOf('PhpOffice\\PhpWord\\PhpWord', $phpWord); $this->assertTrue($phpWord->getSettings()->hasDoNotTrackMoves()); $this->assertFalse($phpWord->getSettings()->hasDoNotTrackFormatting()); $this->assertEquals(100, $phpWord->getSettings()->getZoom()); $doc = TestHelperDOCX::getDocument($phpWord); $this->assertFalse($doc->elementExists('/w:document/w:body/w:p/w:r[w:t/node()="italics"]/w:rPr/w:b')); } }