From 8381601e5e76c683615013415ac99cd5243f8204 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Thu, 31 Mar 2016 15:02:02 +0200 Subject: [PATCH] #123 : Support for Video (Fix PHPUnit tests) --- src/PhpPresentation/Writer/ODPresentation.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/PhpPresentation/Writer/ODPresentation.php b/src/PhpPresentation/Writer/ODPresentation.php index caf23d6d4..77cc0ca0b 100644 --- a/src/PhpPresentation/Writer/ODPresentation.php +++ b/src/PhpPresentation/Writer/ODPresentation.php @@ -99,18 +99,26 @@ public function save($pFilename) $oPresentation = $this->getPhpPresentation(); $arrayChart = array(); + $arrayFiles = array(); $oDir = new DirectoryIterator(dirname(__FILE__).DIRECTORY_SEPARATOR.'ODPresentation'); foreach ($oDir as $oFile) { if (!$oFile->isFile()) { continue; } - $class = __NAMESPACE__.'\\ODPresentation\\'.$oFile->getBasename('.php'); + + $class = __NAMESPACE__ . '\\ODPresentation\\' . $oFile->getBasename('.php'); $o = new \ReflectionClass($class); if ($o->isAbstract() || !$o->isSubclassOf('PhpOffice\PhpPresentation\Writer\ODPresentation\AbstractDecoratorWriter')) { continue; } - echo "\n".dirname(__FILE__).DIRECTORY_SEPARATOR.'ODPresentation'."/".$oFile->getBasename('.php')."\n"; + $arrayFiles[$oFile->getBasename('.php')] = $o; + } + + ksort($arrayFiles); + + foreach ($arrayFiles as $basename => $o) { + echo "\n".dirname(__FILE__).DIRECTORY_SEPARATOR.'ODPresentation'."/".$basename."\n"; $oService = $o->newInstance(); $oService->setZip($oZip); $oService->setPresentation($oPresentation);