1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <?php
-
-
- namespace PhpOffice\PhpWord\Tests;
-
- use PhpOffice\PhpWord\IOFactory;
- use PhpOffice\PhpWord\PhpWord;
-
-
- class IOFactoryTest extends \PHPUnit_Framework_TestCase
- {
-
-
- public function testExistingWriterCanBeCreated()
- {
- $this->assertInstanceOf(
- 'PhpOffice\\PhpWord\\Writer\\Word2007',
- IOFactory::createWriter(new PhpWord(), 'Word2007')
- );
- }
-
-
-
- public function testNonexistentWriterCanNotBeCreated()
- {
- IOFactory::createWriter(new PhpWord(), 'Word2006');
- }
-
-
-
- public function testExistingReaderCanBeCreated()
- {
- $this->assertInstanceOf(
- 'PhpOffice\\PhpWord\\Reader\\Word2007',
- IOFactory::createReader('Word2007')
- );
- }
-
-
-
- public function testNonexistentReaderCanNotBeCreated()
- {
- IOFactory::createReader('Word2006');
- }
-
-
-
- public function testLoad()
- {
- $file = __DIR__ . "/_files/templates/blank.docx";
- $this->assertInstanceOf(
- 'PhpOffice\\PhpWord\\PhpWord',
- IOFactory::load($file)
- );
- }
- }
|