assertTrue($object->canRead($file)); } /** * @expectedException \PhpOffice\PhpWord\Exceptions\Exception */ public function testCanReadFailed() { $dir = __DIR__ . "/../_files/documents"; $object = new Word2007; $file = $dir . \DIRECTORY_SEPARATOR . 'foo.docx'; $this->assertFalse($object->canRead($file)); $object = IOFactory::load($file); } /** * Test load document */ public function testLoad() { $dir = __DIR__ . "/../_files/documents"; $file = $dir . \DIRECTORY_SEPARATOR . 'reader.docx'; $object = IOFactory::load($file); $this->assertInstanceOf('PhpOffice\\PhpWord\\PhpWord', $object); } }