/** * Test save */ public function testSave() { $filename = tempnam(sys_get_temp_dir(), 'PhpPresentation'); $imageFile = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/images/PhpPresentationLogo.png'; $oPhpPresentation = new PhpPresentation(); $slide = $oPhpPresentation->getActiveSlide(); $slide->createRichTextShape(); $slide->createLineShape(10, 10, 10, 10); $slide->createChartShape()->getPlotArea()->setType(new \PhpOffice\PhpPresentation\Shape\Chart\Type\Bar3D()); $slide->createDrawingShape()->setName('Drawing')->setPath($imageFile); $slide->createTableShape()->createRow(); $object = new PowerPoint2007($oPhpPresentation); $object->save($filename); $this->assertTrue(file_exists($filename)); unlink($filename); }
/** * Test save with empty assignation * * @expectedException Exception * @expectedExceptionMessage No PhpPresentation assigned. */ public function testSaveUnassignedException() { $object = new PowerPoint2007(); $object->save('filename.pptx'); }