assertTrue($object->canRead($file)); } /** * @expectedException \Exception * @expectedExceptionMessage Could not open for reading! File does not exist. */ public function testLoadFileNotExists() { $object = new Serialized(); $object->load(''); } /** * @expectedException \Exception * @expectedExceptionMessage Invalid file format for PhpOffice\PhpPresentation\Reader\Serialized: */ public function testLoadFileBadFormat() { $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_01_Simple.pptx'; $object = new Serialized(); $object->load($file); } /** * @expectedException \Exception * @expectedExceptionMessage Could not open for reading! File does not exist. */ public function testFileSupportsNotExists() { $object = new Serialized(); $object->fileSupportsUnserializePhpPresentation(''); } public function testLoadSerializedFileNotExists() { $file = tempnam(sys_get_temp_dir(), 'PhpPresentation_Serialized'); $oArchive = new \ZipArchive(); $oArchive->open($file, \ZipArchive::CREATE); $oArchive->addFromString('PhpPresentation.xml', ''); $oArchive->close(); $object = new Serialized(); $this->assertNull($object->load($file)); } }