expectException(Exception::class); IOFactory::createWriter(new PhpWord(), 'Word2006'); } /** * Create existing reader. */ public function testExistingReaderCanBeCreated(): void { self::assertInstanceOf( 'PhpOffice\\PhpWord\\Reader\\Word2007', IOFactory::createReader('Word2007') ); } /** * Create non-existing reader. */ public function testNonexistentReaderCanNotBeCreated(): void { $this->expectException(Exception::class); IOFactory::createReader('Word2006'); } /** * Load document. */ public function testLoad(): void { $file = __DIR__ . '/_files/templates/blank.docx'; self::assertInstanceOf( 'PhpOffice\\PhpWord\\PhpWord', IOFactory::load($file) ); } }