assertInstanceOf($class, IOFactory::createWriter(new PhpPresentation())); } /** * Test create reader */ public function testCreateReader() { $class = 'PhpOffice\\PhpPresentation\\Reader\\ReaderInterface'; $this->assertInstanceOf($class, IOFactory::createReader('Serialized')); } /** * Test load class exception * * @expectedException \Exception * @expectedExceptionMessage is not a valid reader */ public function testLoadClassException() { IOFactory::createReader(); } public function testLoad() { $this->assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', IOFactory::load(PHPPRESENTATION_TESTS_BASE_DIR.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'files'.DIRECTORY_SEPARATOR.'serialized.phppt')); } /** * Test load class exception * * @expectedException \Exception * @expectedExceptionMessage Could not automatically determine \PhpOffice\PhpPresentation\Reader\ReaderInterface for file. */ public function testLoadException() { IOFactory::load(PHPPRESENTATION_TESTS_BASE_DIR.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'images'.DIRECTORY_SEPARATOR.'PhpPresentationLogo.png'); } }