PhpOffice\PhpPresentation\Tests\Writer\ODPresentationTest::testSave PHP Method

testSave() public method

Test save
public testSave ( )
    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 ODPresentation($oPhpPresentation);
        $object->save($filename);
        $this->assertTrue(file_exists($filename));
        unlink($filename);
    }