From 5cfa50f8181a1c315beb401efa669f41a83384d8 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Tue, 7 Jul 2015 12:37:29 +0200 Subject: [PATCH 01/15] Removed deprecated methods --- CHANGELOG.md | 15 ++++++ src/PhpPowerpoint/AbstractShape.php | 25 --------- src/PhpPowerpoint/DocumentLayout.php | 52 ------------------- src/PhpPowerpoint/Style/Font.php | 12 ----- .../PhpPowerpoint/Tests/AbstractShapeTest.php | 31 ----------- .../Tests/DocumentLayoutTest.php | 10 ---- tests/PhpPowerpoint/Tests/Style/FontTest.php | 8 +-- 7 files changed, 19 insertions(+), 134 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a5d1f3a52..80b74039a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,19 @@ # Changelog +## 0.5.0 - Not released + +### Features + +### Bugfix + +### Miscellaneous +- PhpOffice\PhpPowerpoint\Style\Font::setStriketrough has been removed : Use setStrikethrough +- PhpOffice\PhpPowerpoint\AbstractShape::getSlide has been removed +- PhpOffice\PhpPowerpoint\AbstractShape::setSlide has been removed +- PhpOffice\PhpPowerpoint\DocumentLayout::getLayoutXmilli has been removed : getCX(DocumentLayout::UNIT_MILLIMETER) +- PhpOffice\PhpPowerpoint\DocumentLayout::getLayoutYmilli has been removed : getCY(DocumentLayout::UNIT_MILLIMETER) +- PhpOffice\PhpPowerpoint\DocumentLayout::setLayoutXmilli has been removed : setCX(DocumentLayout::UNIT_MILLIMETER) +- PhpOffice\PhpPowerpoint\DocumentLayout::setLayoutYmilli has been removed : setCY(DocumentLayout::UNIT_MILLIMETER) + ## 0.4.0 - 2015-07-07 ### Features diff --git a/src/PhpPowerpoint/AbstractShape.php b/src/PhpPowerpoint/AbstractShape.php index 3da295916..b58d7ee94 100644 --- a/src/PhpPowerpoint/AbstractShape.php +++ b/src/PhpPowerpoint/AbstractShape.php @@ -180,31 +180,6 @@ public function setContainer(ShapeContainerInterface $pValue = null, $pOverrideO return $this; } - /** - * Get Slide - * - * @return \PhpOffice\PhpPowerpoint\Container - * @deprecated - */ - public function getSlide() - { - return $this->getContainer(); - } - - /** - * Set Slide - * - * @param \PhpOffice\PhpPowerpoint\Slide $pValue - * @param bool $pOverrideOld If a Slide has already been assigned, overwrite it and remove image from old Slide? - * @throws \Exception - * @return self - * @deprecated - */ - public function setSlide(Slide $pValue = null, $pOverrideOld = false) - { - return $this->setContainer($pValue, $pOverrideOld); - } - /** * Get OffsetX * diff --git a/src/PhpPowerpoint/DocumentLayout.php b/src/PhpPowerpoint/DocumentLayout.php index 1c82271b3..86861820a 100644 --- a/src/PhpPowerpoint/DocumentLayout.php +++ b/src/PhpPowerpoint/DocumentLayout.php @@ -244,56 +244,4 @@ protected function convertUnit($value, $fromUnit, $toUnit) } return $value; } - - /** - * Get Document Layout in millimeters - * - * @return integer - * @deprecated 0.4.0 getCX(DocumentLayout::UNIT_MILLIMETER) - */ - public function getLayoutXmilli() - { - return $this->dimensionX / 36000; - } - - /** - * Get Document Layout in millimeters - * - * @return integer - * @deprecated 0.4.0 getCY(DocumentLayout::UNIT_MILLIMETER) - */ - public function getLayoutYmilli() - { - return $this->dimensionY / 36000; - } - - /** - * Set Document Layout in millimeters - * - * @param integer $pValue Layout width - * @return \PhpOffice\PhpPowerpoint\DocumentLayout - * @deprecated 0.4.0 setCY($pValue, DocumentLayout::UNIT_MILLIMETER) - */ - public function setLayoutXmilli($pValue) - { - $this->dimensionX = $pValue * 36000; - $this->layout = self::LAYOUT_CUSTOM; - - return $this; - } - - /** - * Set Document Layout in millimeters - * - * @param integer $pValue Layout height - * @return \PhpOffice\PhpPowerpoint\DocumentLayout - * @deprecated 0.4.0 setCY($pValue, DocumentLayout::UNIT_MILLIMETER) - */ - public function setLayoutYmilli($pValue) - { - $this->dimensionY = $pValue * 36000; - $this->layout = self::LAYOUT_CUSTOM; - - return $this; - } } diff --git a/src/PhpPowerpoint/Style/Font.php b/src/PhpPowerpoint/Style/Font.php index fc1019a63..0e1415a5a 100644 --- a/src/PhpPowerpoint/Style/Font.php +++ b/src/PhpPowerpoint/Style/Font.php @@ -315,18 +315,6 @@ public function setUnderline($pValue = self::UNDERLINE_NONE) return $this; } - /** - * Set Striketrough - * - * @deprecated Use setStrikethrough() instead. - * @param boolean $pValue - * @return \PhpOffice\PhpPowerpoint\Style\Font - */ - public function setStriketrough($pValue = false) - { - return $this->setStrikethrough($pValue); - } - /** * Get Strikethrough * diff --git a/tests/PhpPowerpoint/Tests/AbstractShapeTest.php b/tests/PhpPowerpoint/Tests/AbstractShapeTest.php index 93c26efb9..30719365c 100644 --- a/tests/PhpPowerpoint/Tests/AbstractShapeTest.php +++ b/tests/PhpPowerpoint/Tests/AbstractShapeTest.php @@ -36,7 +36,6 @@ public function testConstruct() { $object = new RichText(); - $this->assertNull($object->getSlide()); $this->assertEquals(0, $object->getOffsetX()); $this->assertEquals(0, $object->getOffsetY()); $this->assertEquals(0, $object->getHeight()); @@ -126,36 +125,6 @@ public function testShadow() $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Shadow', $object->getShadow()); } - public function testSlide() - { - $object = new RichText(); - $oSlide1 = new Slide(); - $oSlide2 = new Slide(); - $oSlide3 = new Slide(); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setSlide()); - $this->assertNull($object->getSlide()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setSlide($oSlide1, true)); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide', $object->getSlide()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setSlide($oSlide2, true)); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide', $object->getSlide()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setSlide($oSlide3, true)); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide', $object->getSlide()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setSlide($oSlide3, true)); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide', $object->getSlide()); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage A \PhpOffice\PhpPowerpoint\ShapeContainerInterface has already been assigned. Shapes can only exist on one \PhpOffice\PhpPowerpoint\ShapeContainerInterface. - */ - public function testSlideException() - { - $object = new RichText(); - $object->setSlide(new Slide()); - $object->setSlide(new Slide()); - } - public function testWidth() { $object = new RichText(); diff --git a/tests/PhpPowerpoint/Tests/DocumentLayoutTest.php b/tests/PhpPowerpoint/Tests/DocumentLayoutTest.php index b36b2c4bd..f7ddf67bd 100644 --- a/tests/PhpPowerpoint/Tests/DocumentLayoutTest.php +++ b/tests/PhpPowerpoint/Tests/DocumentLayoutTest.php @@ -36,8 +36,6 @@ public function testConstruct() $this->assertEquals('screen4x3', $object->getDocumentLayout()); $this->assertEquals(9144000, $object->getCX()); $this->assertEquals(6858000, $object->getCY()); - $this->assertEquals(9144000 / 36000, $object->getLayoutXmilli()); - $this->assertEquals(6858000 / 36000, $object->getLayoutYmilli()); } /** @@ -70,14 +68,10 @@ public function testCX() $this->assertEquals($value, $object->getCX(DocumentLayout::UNIT_INCH)); $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCX($value, DocumentLayout::UNIT_MILLIMETER)); $this->assertEquals($value, $object->getCX(DocumentLayout::UNIT_MILLIMETER)); - $this->assertEquals($value, $object->getLayoutXmilli()); $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCX($value, DocumentLayout::UNIT_POINT)); $this->assertEquals($value, $object->getCX(DocumentLayout::UNIT_POINT)); $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCX($value, DocumentLayout::UNIT_PIXEL)); $this->assertEquals($value, $object->getCX(DocumentLayout::UNIT_PIXEL)); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setLayoutXmilli($value)); - $this->assertEquals($value, $object->getCX(DocumentLayout::UNIT_MILLIMETER)); - $this->assertEquals($value, $object->getLayoutXmilli()); } public function testCY() @@ -94,13 +88,9 @@ public function testCY() $this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_INCH)); $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_MILLIMETER)); $this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_MILLIMETER)); - $this->assertEquals($value, $object->getLayoutYmilli()); $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_POINT)); $this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_POINT)); $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_PIXEL)); $this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_PIXEL)); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setLayoutYmilli($value)); - $this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_MILLIMETER)); - $this->assertEquals($value, $object->getLayoutYmilli()); } } diff --git a/tests/PhpPowerpoint/Tests/Style/FontTest.php b/tests/PhpPowerpoint/Tests/Style/FontTest.php index a5a5050b7..f835786d8 100644 --- a/tests/PhpPowerpoint/Tests/Style/FontTest.php +++ b/tests/PhpPowerpoint/Tests/Style/FontTest.php @@ -139,13 +139,13 @@ public function testSetIsItalic() public function testSetIsStriketrough() { $object = new Font(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setStriketrough()); + $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setStrikethrough()); $this->assertFalse($object->isStrikethrough()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setStriketrough('')); + $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setStrikethrough('')); $this->assertFalse($object->isStrikethrough()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setStriketrough(false)); + $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setStrikethrough(false)); $this->assertFalse($object->isStrikethrough()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setStriketrough(true)); + $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setStrikethrough(true)); $this->assertTrue($object->isStrikethrough()); } From b4e8fdd26e0e76f341e44a03eb3f23a51912c9b2 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Wed, 8 Jul 2015 12:45:09 +0200 Subject: [PATCH 02/15] Update the dependence PhpOffice\Common to 0.2.* --- .gitignore | 1 + CHANGELOG.md | 17 +++--- composer.json | 2 +- src/PhpPowerpoint/Reader/PowerPoint97.php | 8 +-- .../Writer/ODPresentation/Content.php | 56 +++++++++---------- .../Writer/ODPresentation/ObjectsChart.php | 14 ++--- .../Writer/ODPresentation/Styles.php | 6 +- .../Writer/PowerPoint2007/Slide.php | 4 +- 8 files changed, 55 insertions(+), 53 deletions(-) diff --git a/.gitignore b/.gitignore index 54a5d8203..2e0a455ed 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ vendor /samples/#* /samples/Github_*.* /samples/results +/composer.lock diff --git a/CHANGELOG.md b/CHANGELOG.md index 80b74039a..438031b59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,14 +5,15 @@ ### Bugfix -### Miscellaneous -- PhpOffice\PhpPowerpoint\Style\Font::setStriketrough has been removed : Use setStrikethrough -- PhpOffice\PhpPowerpoint\AbstractShape::getSlide has been removed -- PhpOffice\PhpPowerpoint\AbstractShape::setSlide has been removed -- PhpOffice\PhpPowerpoint\DocumentLayout::getLayoutXmilli has been removed : getCX(DocumentLayout::UNIT_MILLIMETER) -- PhpOffice\PhpPowerpoint\DocumentLayout::getLayoutYmilli has been removed : getCY(DocumentLayout::UNIT_MILLIMETER) -- PhpOffice\PhpPowerpoint\DocumentLayout::setLayoutXmilli has been removed : setCX(DocumentLayout::UNIT_MILLIMETER) -- PhpOffice\PhpPowerpoint\DocumentLayout::setLayoutYmilli has been removed : setCY(DocumentLayout::UNIT_MILLIMETER) +### Changes +- PhpOffice\PhpPowerpoint\Style\Font::setStriketrough has been removed : Use setStrikethrough - @Progi1984 +- PhpOffice\PhpPowerpoint\AbstractShape::getSlide has been removed - @Progi1984 +- PhpOffice\PhpPowerpoint\AbstractShape::setSlide has been removed - @Progi1984 +- PhpOffice\PhpPowerpoint\DocumentLayout::getLayoutXmilli has been removed : getCX(DocumentLayout::UNIT_MILLIMETER) - @Progi1984 +- PhpOffice\PhpPowerpoint\DocumentLayout::getLayoutYmilli has been removed : getCY(DocumentLayout::UNIT_MILLIMETER) - @Progi1984 +- PhpOffice\PhpPowerpoint\DocumentLayout::setLayoutXmilli has been removed : setCX(DocumentLayout::UNIT_MILLIMETER) - @Progi1984 +- PhpOffice\PhpPowerpoint\DocumentLayout::setLayoutYmilli has been removed : setCY(DocumentLayout::UNIT_MILLIMETER) - @Progi1984 +- Update the dependence PhpOffice\Common to 0.2.* - @Progi1984 ## 0.4.0 - 2015-07-07 diff --git a/composer.json b/composer.json index 6e156c85a..5fcf68162 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "php": ">=5.3.0", "ext-xml": "*", "ext-zip": "*", - "phpoffice/common": "0.1.*" + "phpoffice/common": "0.2.*" }, "require-dev": { "phpunit/phpunit": "3.7.*", diff --git a/src/PhpPowerpoint/Reader/PowerPoint97.php b/src/PhpPowerpoint/Reader/PowerPoint97.php index 47fbe04bc..f4813cc49 100644 --- a/src/PhpPowerpoint/Reader/PowerPoint97.php +++ b/src/PhpPowerpoint/Reader/PowerPoint97.php @@ -28,7 +28,7 @@ use PhpOffice\PhpPowerpoint\Style\Bullet; use PhpOffice\PhpPowerpoint\Shape\Hyperlink; use PhpOffice\PhpPowerpoint\Shape\Line; -use PhpOffice\Common\String; +use PhpOffice\Common\Text; use PhpOffice\PhpPowerPoint\Shape\Group; use PhpOffice\PhpPowerpoint\Shape\PhpOffice\PhpPowerpoint\Shape; @@ -1256,7 +1256,7 @@ private function readRecordOfficeArtClientTextbox($stream, $pos) if ($char == 0x0B) { $char = 0x20; } - $arrayReturn['text'] .= String::chr($char); + $arrayReturn['text'] .= Text::chr($char); $arrayReturn['length'] += 1; } break; @@ -1269,7 +1269,7 @@ private function readRecordOfficeArtClientTextbox($stream, $pos) if ($char == 0x0B) { $char = 0x20; } - $arrayReturn['text'] .= String::chr($char); + $arrayReturn['text'] .= Text::chr($char); $arrayReturn['length'] += 2; } break; @@ -2623,7 +2623,7 @@ private function readRecordSlideNameAtom($stream, $pos) for ($inc = 0; $inc < $strLen; $inc++) { $char = self::getInt2d($stream, $pos + $arrayReturn['length']); $arrayReturn['length'] += 2; - $arrayReturn['slideName'] .= String::chr($char); + $arrayReturn['slideName'] .= Text::chr($char); } } diff --git a/src/PhpPowerpoint/Writer/ODPresentation/Content.php b/src/PhpPowerpoint/Writer/ODPresentation/Content.php index e5e82f3a2..181d206e2 100644 --- a/src/PhpPowerpoint/Writer/ODPresentation/Content.php +++ b/src/PhpPowerpoint/Writer/ODPresentation/Content.php @@ -18,7 +18,7 @@ namespace PhpOffice\PhpPowerpoint\Writer\ODPresentation; use PhpOffice\Common\Drawing as CommonDrawing; -use PhpOffice\Common\String; +use PhpOffice\Common\Text; use PhpOffice\Common\XMLWriter; use PhpOffice\PhpPowerpoint\Slide; use PhpOffice\PhpPowerpoint\PhpPowerpoint; @@ -318,10 +318,10 @@ public function writeShapePic(XMLWriter $objWriter, AbstractDrawing $shape) // draw:frame $objWriter->startElement('draw:frame'); $objWriter->writeAttribute('draw:name', $shape->getName()); - $objWriter->writeAttribute('svg:width', String::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getWidth()), 3) . 'cm'); - $objWriter->writeAttribute('svg:height', String::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getHeight()), 3) . 'cm'); - $objWriter->writeAttribute('svg:x', String::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getOffsetX()), 3) . 'cm'); - $objWriter->writeAttribute('svg:y', String::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getOffsetY()), 3) . 'cm'); + $objWriter->writeAttribute('svg:width', Text::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getWidth()), 3) . 'cm'); + $objWriter->writeAttribute('svg:height', Text::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getHeight()), 3) . 'cm'); + $objWriter->writeAttribute('svg:x', Text::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getOffsetX()), 3) . 'cm'); + $objWriter->writeAttribute('svg:y', Text::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getOffsetY()), 3) . 'cm'); $objWriter->writeAttribute('draw:style-name', 'gr' . $this->shapeId); // draw:image $objWriter->startElement('draw:image'); @@ -367,10 +367,10 @@ public function writeShapeTxt(XMLWriter $objWriter, RichText $shape) // draw:frame $objWriter->startElement('draw:frame'); $objWriter->writeAttribute('draw:style-name', 'gr' . $this->shapeId); - $objWriter->writeAttribute('svg:width', String::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getWidth()), 3) . 'cm'); - $objWriter->writeAttribute('svg:height', String::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getHeight()), 3) . 'cm'); - $objWriter->writeAttribute('svg:x', String::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getOffsetX()), 3) . 'cm'); - $objWriter->writeAttribute('svg:y', String::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getOffsetY()), 3) . 'cm'); + $objWriter->writeAttribute('svg:width', Text::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getWidth()), 3) . 'cm'); + $objWriter->writeAttribute('svg:height', Text::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getHeight()), 3) . 'cm'); + $objWriter->writeAttribute('svg:x', Text::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getOffsetX()), 3) . 'cm'); + $objWriter->writeAttribute('svg:y', Text::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getOffsetY()), 3) . 'cm'); // draw:text-box $objWriter->startElement('draw:text-box'); @@ -527,10 +527,10 @@ public function writeShapeLine(XMLWriter $objWriter, Line $shape) // draw:line $objWriter->startElement('draw:line'); $objWriter->writeAttribute('draw:style-name', 'gr' . $this->shapeId); - $objWriter->writeAttribute('svg:x1', String::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getOffsetX()), 3) . 'cm'); - $objWriter->writeAttribute('svg:y1', String::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getOffsetY()), 3) . 'cm'); - $objWriter->writeAttribute('svg:x2', String::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getOffsetX()+$shape->getWidth()), 3) . 'cm'); - $objWriter->writeAttribute('svg:y2', String::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getOffsetY()+$shape->getHeight()), 3) . 'cm'); + $objWriter->writeAttribute('svg:x1', Text::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getOffsetX()), 3) . 'cm'); + $objWriter->writeAttribute('svg:y1', Text::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getOffsetY()), 3) . 'cm'); + $objWriter->writeAttribute('svg:x2', Text::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getOffsetX()+$shape->getWidth()), 3) . 'cm'); + $objWriter->writeAttribute('svg:y2', Text::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getOffsetY()+$shape->getHeight()), 3) . 'cm'); // text:p $objWriter->writeElement('text:p'); @@ -547,10 +547,10 @@ public function writeShapeTable(XMLWriter $objWriter, Table $shape) { // draw:frame $objWriter->startElement('draw:frame'); - $objWriter->writeAttribute('svg:x', String::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getOffsetX()), 3) . 'cm'); - $objWriter->writeAttribute('svg:y', String::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getOffsetY()), 3) . 'cm'); - $objWriter->writeAttribute('svg:height', String::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getHeight()), 3) . 'cm'); - $objWriter->writeAttribute('svg:width', String::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getWidth()), 3) . 'cm'); + $objWriter->writeAttribute('svg:x', Text::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getOffsetX()), 3) . 'cm'); + $objWriter->writeAttribute('svg:y', Text::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getOffsetY()), 3) . 'cm'); + $objWriter->writeAttribute('svg:height', Text::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getHeight()), 3) . 'cm'); + $objWriter->writeAttribute('svg:width', Text::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getWidth()), 3) . 'cm'); // table:table $objWriter->startElement('table:table'); @@ -641,10 +641,10 @@ public function writeShapeChart(XMLWriter $objWriter, Chart $shape) // draw:frame $objWriter->startElement('draw:frame'); $objWriter->writeAttribute('draw:name', $shape->getTitle()->getText()); - $objWriter->writeAttribute('svg:x', String::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getOffsetX()), 3) . 'cm'); - $objWriter->writeAttribute('svg:y', String::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getOffsetY()), 3) . 'cm'); - $objWriter->writeAttribute('svg:height', String::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getHeight()), 3) . 'cm'); - $objWriter->writeAttribute('svg:width', String::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getWidth()), 3) . 'cm'); + $objWriter->writeAttribute('svg:x', Text::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getOffsetX()), 3) . 'cm'); + $objWriter->writeAttribute('svg:y', Text::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getOffsetY()), 3) . 'cm'); + $objWriter->writeAttribute('svg:height', Text::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getHeight()), 3) . 'cm'); + $objWriter->writeAttribute('svg:width', Text::numberFormat(CommonDrawing::pixelsToCentimeters($shape->getWidth()), 3) . 'cm'); // draw:object $objWriter->startElement('draw:object'); @@ -888,7 +888,7 @@ public function writeLineStyle(XMLWriter $objWriter, Line $shape) break; } $objWriter->writeAttribute('svg:stroke-color', '#'.$shape->getBorder()->getColor()->getRGB()); - $objWriter->writeAttribute('svg:stroke-width', String::numberFormat(CommonDrawing::pixelsToCentimeters((CommonDrawing::pointsToPixels($shape->getBorder()->getLineWidth()))), 3).'cm'); + $objWriter->writeAttribute('svg:stroke-width', Text::numberFormat(CommonDrawing::pixelsToCentimeters((CommonDrawing::pointsToPixels($shape->getBorder()->getLineWidth()))), 3).'cm'); $objWriter->endElement(); $objWriter->endElement(); @@ -910,7 +910,7 @@ public function writeTableStyle(XMLWriter $objWriter, Table $shape) // style:table-row-properties $objWriter->startElement('style:table-row-properties'); - $objWriter->writeAttribute('style:row-height', String::numberFormat(CommonDrawing::pixelsToCentimeters(CommonDrawing::pointsToPixels($shapeRow->getHeight())), 3).'cm'); + $objWriter->writeAttribute('style:row-height', Text::numberFormat(CommonDrawing::pixelsToCentimeters(CommonDrawing::pointsToPixels($shapeRow->getHeight())), 3).'cm'); $objWriter->endElement(); $objWriter->endElement(); @@ -940,7 +940,7 @@ public function writeTableStyle(XMLWriter $objWriter, Table $shape) && $shapeCell->getBorders()->getBottom()->getHashCode() == $shapeCell->getBorders()->getLeft()->getHashCode() && $shapeCell->getBorders()->getBottom()->getHashCode() == $shapeCell->getBorders()->getRight()->getHashCode()) { $lineStyle = 'none'; - $lineWidth = String::numberFormat($shapeCell->getBorders()->getBottom()->getLineWidth() / 1.75, 2); + $lineWidth = Text::numberFormat($shapeCell->getBorders()->getBottom()->getLineWidth() / 1.75, 2); $lineColor = $shapeCell->getBorders()->getBottom()->getColor()->getRGB(); switch ($shapeCell->getBorders()->getBottom()->getLineStyle()) { case Border::LINE_SINGLE: @@ -949,7 +949,7 @@ public function writeTableStyle(XMLWriter $objWriter, Table $shape) $objWriter->writeAttribute('fo:border', $lineWidth.'pt '.$lineStyle.' #'.$lineColor); } else { $lineStyle = 'none'; - $lineWidth = String::numberFormat($shapeCell->getBorders()->getBottom()->getLineWidth() / 1.75, 2); + $lineWidth = Text::numberFormat($shapeCell->getBorders()->getBottom()->getLineWidth() / 1.75, 2); $lineColor = $shapeCell->getBorders()->getBottom()->getColor()->getRGB(); switch ($shapeCell->getBorders()->getBottom()->getLineStyle()) { case Border::LINE_SINGLE: @@ -958,7 +958,7 @@ public function writeTableStyle(XMLWriter $objWriter, Table $shape) $objWriter->writeAttribute('fo:border-bottom', $lineWidth.'pt '.$lineStyle.' #'.$lineColor); // TOP $lineStyle = 'none'; - $lineWidth = String::numberFormat($shapeCell->getBorders()->getTop()->getLineWidth() / 1.75, 2); + $lineWidth = Text::numberFormat($shapeCell->getBorders()->getTop()->getLineWidth() / 1.75, 2); $lineColor = $shapeCell->getBorders()->getTop()->getColor()->getRGB(); switch ($shapeCell->getBorders()->getTop()->getLineStyle()) { case Border::LINE_SINGLE: @@ -967,7 +967,7 @@ public function writeTableStyle(XMLWriter $objWriter, Table $shape) $objWriter->writeAttribute('fo:border-top', $lineWidth.'pt '.$lineStyle.' #'.$lineColor); // RIGHT $lineStyle = 'none'; - $lineWidth = String::numberFormat($shapeCell->getBorders()->getRight()->getLineWidth() / 1.75, 2); + $lineWidth = Text::numberFormat($shapeCell->getBorders()->getRight()->getLineWidth() / 1.75, 2); $lineColor = $shapeCell->getBorders()->getRight()->getColor()->getRGB(); switch ($shapeCell->getBorders()->getRight()->getLineStyle()) { case Border::LINE_SINGLE: @@ -976,7 +976,7 @@ public function writeTableStyle(XMLWriter $objWriter, Table $shape) $objWriter->writeAttribute('fo:border-right', $lineWidth.'pt '.$lineStyle.' #'.$lineColor); // LEFT $lineStyle = 'none'; - $lineWidth = String::numberFormat($shapeCell->getBorders()->getLeft()->getLineWidth() / 1.75, 2); + $lineWidth = Text::numberFormat($shapeCell->getBorders()->getLeft()->getLineWidth() / 1.75, 2); $lineColor = $shapeCell->getBorders()->getLeft()->getColor()->getRGB(); switch ($shapeCell->getBorders()->getLeft()->getLineStyle()) { case Border::LINE_SINGLE: diff --git a/src/PhpPowerpoint/Writer/ODPresentation/ObjectsChart.php b/src/PhpPowerpoint/Writer/ODPresentation/ObjectsChart.php index 5e78f9715..a3e67ce97 100644 --- a/src/PhpPowerpoint/Writer/ODPresentation/ObjectsChart.php +++ b/src/PhpPowerpoint/Writer/ODPresentation/ObjectsChart.php @@ -18,7 +18,7 @@ namespace PhpOffice\PhpPowerpoint\Writer\ODPresentation; use PhpOffice\Common\Drawing as CommonDrawing; -use PhpOffice\Common\String; +use PhpOffice\Common\Text; use PhpOffice\Common\XMLWriter; use PhpOffice\PhpPowerpoint\PhpPowerpoint; use PhpOffice\PhpPowerpoint\Shape\Chart; @@ -199,8 +199,8 @@ private function writeContentPart(Chart $chart) $this->xmlContent->startElement('office:chart'); // office:chart $this->xmlContent->startElement('chart:chart'); - $this->xmlContent->writeAttribute('svg:width', String::numberFormat(CommonDrawing::pixelsToCentimeters($chart->getWidth()), 3) . 'cm'); - $this->xmlContent->writeAttribute('svg:height', String::numberFormat(CommonDrawing::pixelsToCentimeters($chart->getHeight()), 3) . 'cm'); + $this->xmlContent->writeAttribute('svg:width', Text::numberFormat(CommonDrawing::pixelsToCentimeters($chart->getWidth()), 3) . 'cm'); + $this->xmlContent->writeAttribute('svg:height', Text::numberFormat(CommonDrawing::pixelsToCentimeters($chart->getHeight()), 3) . 'cm'); $this->xmlContent->writeAttribute('xlink:href', '.'); $this->xmlContent->writeAttribute('xlink:type', 'simple'); $this->xmlContent->writeAttribute('chart:style-name', 'styleChart'); @@ -387,8 +387,8 @@ private function writeLegend(Chart $chart) // chart:legend $this->xmlContent->startElement('chart:legend'); $this->xmlContent->writeAttribute('chart:legend-position', 'end'); - $this->xmlContent->writeAttribute('svg:x', String::numberFormat(CommonDrawing::pixelsToCentimeters($chart->getLegend()->getOffsetX()), 3) . 'cm'); - $this->xmlContent->writeAttribute('svg:y', String::numberFormat(CommonDrawing::pixelsToCentimeters($chart->getLegend()->getOffsetY()), 3) . 'cm'); + $this->xmlContent->writeAttribute('svg:x', Text::numberFormat(CommonDrawing::pixelsToCentimeters($chart->getLegend()->getOffsetX()), 3) . 'cm'); + $this->xmlContent->writeAttribute('svg:y', Text::numberFormat(CommonDrawing::pixelsToCentimeters($chart->getLegend()->getOffsetY()), 3) . 'cm'); $this->xmlContent->writeAttribute('style:legend-expansion', 'high'); $this->xmlContent->writeAttribute('chart:style-name', 'styleLegend'); // > chart:legend @@ -764,8 +764,8 @@ private function writeTitle(Title $oTitle) if ($oTitle->isVisible()) { // chart:title $this->xmlContent->startElement('chart:title'); - $this->xmlContent->writeAttribute('svg:x', String::numberFormat(CommonDrawing::pixelsToCentimeters($oTitle->getOffsetX()), 3) . 'cm'); - $this->xmlContent->writeAttribute('svg:y', String::numberFormat(CommonDrawing::pixelsToCentimeters($oTitle->getOffsetY()), 3) . 'cm'); + $this->xmlContent->writeAttribute('svg:x', Text::numberFormat(CommonDrawing::pixelsToCentimeters($oTitle->getOffsetX()), 3) . 'cm'); + $this->xmlContent->writeAttribute('svg:y', Text::numberFormat(CommonDrawing::pixelsToCentimeters($oTitle->getOffsetY()), 3) . 'cm'); $this->xmlContent->writeAttribute('chart:style-name', 'styleTitle'); // > text:p $this->xmlContent->startElement('text:p'); diff --git a/src/PhpPowerpoint/Writer/ODPresentation/Styles.php b/src/PhpPowerpoint/Writer/ODPresentation/Styles.php index a607fc9cd..89d5e9a2e 100644 --- a/src/PhpPowerpoint/Writer/ODPresentation/Styles.php +++ b/src/PhpPowerpoint/Writer/ODPresentation/Styles.php @@ -18,7 +18,7 @@ namespace PhpOffice\PhpPowerpoint\Writer\ODPresentation; use PhpOffice\Common\Drawing as CommonDrawing; -use PhpOffice\Common\String; +use PhpOffice\Common\Text; use PhpOffice\Common\XMLWriter; use PhpOffice\PhpPowerpoint\PhpPowerpoint; use PhpOffice\PhpPowerpoint\Shape\Group; @@ -142,8 +142,8 @@ public function writePart(PHPPowerPoint $pPHPPowerPoint) $objWriter->writeAttribute('fo:margin-bottom', '0cm'); $objWriter->writeAttribute('fo:margin-left', '0cm'); $objWriter->writeAttribute('fo:margin-right', '0cm'); - $objWriter->writeAttribute('fo:page-width', String::numberFormat(CommonDrawing::pixelsToCentimeters(CommonDrawing::emuToPixels($pPHPPowerPoint->getLayout()->getCX())), 1) . 'cm'); - $objWriter->writeAttribute('fo:page-height', String::numberFormat(CommonDrawing::pixelsToCentimeters(CommonDrawing::emuToPixels($pPHPPowerPoint->getLayout()->getCY())), 1) . 'cm'); + $objWriter->writeAttribute('fo:page-width', Text::numberFormat(CommonDrawing::pixelsToCentimeters(CommonDrawing::emuToPixels($pPHPPowerPoint->getLayout()->getCX())), 1) . 'cm'); + $objWriter->writeAttribute('fo:page-height', Text::numberFormat(CommonDrawing::pixelsToCentimeters(CommonDrawing::emuToPixels($pPHPPowerPoint->getLayout()->getCY())), 1) . 'cm'); if ($pPHPPowerPoint->getLayout()->getCX() > $pPHPPowerPoint->getLayout()->getCY()) { $objWriter->writeAttribute('style:print-orientation', 'landscape'); } else { diff --git a/src/PhpPowerpoint/Writer/PowerPoint2007/Slide.php b/src/PhpPowerpoint/Writer/PowerPoint2007/Slide.php index a67395b1b..951b27bee 100644 --- a/src/PhpPowerpoint/Writer/PowerPoint2007/Slide.php +++ b/src/PhpPowerpoint/Writer/PowerPoint2007/Slide.php @@ -18,7 +18,7 @@ namespace PhpOffice\PhpPowerpoint\Writer\PowerPoint2007; use PhpOffice\Common\Drawing as CommonDrawing; -use PhpOffice\Common\String; +use PhpOffice\Common\Text; use PhpOffice\Common\XMLWriter; use PhpOffice\PhpPowerpoint\Shape\AbstractDrawing; use PhpOffice\PhpPowerpoint\Shape\Chart as ShapeChart; @@ -902,7 +902,7 @@ private function writeParagraphs(XMLWriter $objWriter, $paragraphs) // t $objWriter->startElement('a:t'); - $objWriter->writeCData(String::controlCharacterPHP2OOXML($element->getText())); + $objWriter->writeCData(Text::controlCharacterPHP2OOXML($element->getText())); $objWriter->endElement(); $objWriter->endElement(); From 82fa04a77ccb7ec8775c357fa90d8bbcbe65dff5 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Wed, 8 Jul 2015 14:00:52 +0200 Subject: [PATCH 03/15] PhpOffice\PhpPowerpoint becomes PhpOffice\PhpPresentation - GH-25 --- .travis_shell_after_success.sh | 2 + CHANGELOG.md | 1 + LICENSE | 10 +- README.md | 46 ++--- composer.json | 6 +- docs/conf.py | 26 +-- docs/faq.rst | 13 +- docs/general.rst | 26 +-- docs/index.rst | 10 +- docs/installing.rst | 18 +- docs/intro.rst | 28 +-- docs/slides.rst | 2 +- phpmd.xml.dist | 2 +- phpunit.xml.dist | 4 +- ...Presentation.php => Sample_01_Complex.php} | 42 ++-- samples/Sample_01_Simple.php | 28 +-- samples/Sample_02_Serialized.php | 32 +-- samples/Sample_03_Image.php | 24 +-- samples/Sample_04_Table.php | 26 +-- samples/Sample_05_Chart.php | 150 +++++++------- samples/Sample_05_Chart_Line.php | 54 ++--- samples/Sample_05_Chart_with_PHPExcel.php | 40 ++-- samples/Sample_06_Fill.php | 24 +-- samples/Sample_07_Border.php | 24 +-- samples/Sample_08_Group.php | 26 +-- samples/Sample_09_SlideNote.php | 30 +-- samples/Sample_10_Transition.php | 32 +-- samples/Sample_11_Shape.php | 34 ++-- samples/Sample_12_Reader_PowerPoint97.php | 46 ++--- samples/Sample_Header.php | 38 ++-- samples/Sample_X5_Templated.php | 69 ------- ...{phppowerpoint.css => phppresentation.css} | 0 samples/index.php | 6 +- .../AbstractShape.php | 56 +++--- .../Autoloader.php | 14 +- .../ComparableInterface.php | 14 +- .../DocumentLayout.php | 18 +- .../DocumentProperties.php | 36 ++-- .../GeometryCalculator.php | 18 +- .../HashTable.php | 32 +-- .../IOFactory.php | 40 ++-- .../PhpPresentation.php} | 66 +++---- .../Reader/PowerPoint97.php | 79 ++++---- .../Reader/ReaderInterface.php | 16 +- .../Reader/Serialized.php | 40 ++-- .../Shape/AbstractDrawing.php | 30 +-- .../Shape/Chart.php | 48 ++--- .../Shape/Chart/Axis.php | 22 +-- .../Shape/Chart/Legend.php | 62 +++--- .../Shape/Chart/PlotArea.php | 42 ++-- .../Shape/Chart/Series.php | 58 +++--- .../Shape/Chart/Title.php | 50 ++--- .../Shape/Chart/Type/AbstractType.php | 24 +-- .../Shape/Chart/Type/AbstractTypeBar.php | 18 +- .../Shape/Chart/Type/AbstractTypePie.php | 16 +- .../Shape/Chart/Type/Area.php | 16 +- .../Shape/Chart/Type/Bar.php | 16 +- .../Shape/Chart/Type/Bar3D.php | 16 +- .../Shape/Chart/Type/Line.php | 16 +- .../Shape/Chart/Type/Pie.php | 14 +- .../Shape/Chart/Type/Pie3D.php | 14 +- .../Shape/Chart/Type/Scatter.php | 16 +- .../Shape/Chart/View3D.php | 26 +-- .../Shape/Drawing.php | 18 +- .../Shape/Group.php | 44 ++--- .../Shape/Hyperlink.php | 20 +- .../Shape/Line.php | 20 +- .../Shape/MemoryDrawing.php | 22 +-- .../Shape/RichText.php | 76 ++++---- .../Shape/RichText/BreakElement.php | 18 +- .../Shape/RichText/Paragraph.php | 70 +++---- .../Shape/RichText/Run.php | 24 +-- .../Shape/RichText/TextElement.php | 28 +-- .../Shape/RichText/TextElementInterface.php | 16 +- .../Shape/Table.php | 26 +-- .../Shape/Table/Cell.php | 76 ++++---- .../Shape/Table/Row.php | 36 ++-- .../ShapeContainerInterface.php | 20 +- .../Slide.php | 88 ++++----- .../Slide/Iterator.php | 30 +-- .../Slide/Layout.php | 14 +- .../Slide/Note.php | 34 ++-- .../Slide/Transition.php | 16 +- .../Style/Alignment.php | 30 +-- .../Style/Border.php | 32 +-- .../Style/Borders.php | 42 ++-- .../Style/Bullet.php | 28 +-- .../Style/Color.php | 22 +-- .../Style/Fill.php | 40 ++-- .../Style/Font.php | 44 ++--- .../Style/Shadow.php | 24 +-- .../Writer/ODPresentation.php | 102 +++++----- .../Writer/ODPresentation/AbstractPart.php | 32 +-- .../Writer/ODPresentation/Content.php | 76 ++++---- .../Writer/ODPresentation}/Drawing.php | 34 ++-- .../Writer/ODPresentation/Manifest.php | 24 +-- .../Writer/ODPresentation/Meta.php | 40 ++-- .../Writer/ODPresentation/Mimetype.php | 16 +- .../Writer/ODPresentation/ObjectsChart.php | 42 ++-- .../Writer/ODPresentation/Styles.php | 40 ++-- .../Writer/PowerPoint2007.php | 122 ++++++------ .../PowerPoint2007/AbstractLayoutPack.php | 14 +- .../Writer/PowerPoint2007/AbstractPart.php | 28 +-- .../Writer/PowerPoint2007/Chart.php | 80 ++++---- .../Writer/PowerPoint2007/ContentTypes.php | 34 ++-- .../Writer/PowerPoint2007/DocProps.php | 46 ++--- .../Writer/PowerPoint2007}/Drawing.php | 34 ++-- .../PowerPoint2007/LayoutPack/PackDefault.php | 20 +- .../LayoutPack/TemplateBased.php | 20 +- .../Writer/PowerPoint2007/PptProps.php | 14 +- .../Writer/PowerPoint2007/Presentation.php | 40 ++-- .../Writer/PowerPoint2007/Rels.php | 46 ++--- .../Writer/PowerPoint2007/Slide.php | 78 ++++---- .../Writer/PowerPoint2007/Theme.php | 16 +- .../Writer/Serialized.php | 84 ++++---- .../Writer/WriterInterface.php | 14 +- .../PhpPowerpoint/Tests/AbstractShapeTest.php | 154 --------------- .../Tests/Reader/PowerPoint97Test.php | 139 ------------- .../Tests/Shape/Chart/AxisTest.php | 136 ------------- .../Tests/Shape/Chart/PlotAreaTest.php | 111 ----------- .../Tests/Shape/Chart/TitleTest.php | 134 ------------- .../Tests/Shape/Chart/View3DTest.php | 105 ---------- tests/PhpPowerpoint/Tests/Shape/ChartTest.php | 65 ------- .../Tests/Shape/RichText/ParagraphTest.php | 151 -------------- .../Tests/Slide/IteratorTest.php | 51 ----- .../Writer/ODPresentation/DrawingTest.php | 55 ------ .../Writer/PowerPoint2007/ContenTypesTest.php | 50 ----- .../Writer/PowerPoint2007/DrawingTest.php | 55 ------ .../Tests/Writer/SerializedTest.php | 109 ----------- .../Tests/AbstractShapeTest.php | 154 +++++++++++++++ .../Tests/AutoloaderTest.php | 20 +- .../Tests/DocumentLayoutTest.php | 44 ++--- .../Tests/DocumentPropertiesTest.php | 16 +- .../Tests/HashTableTest.php | 18 +- .../Tests/IOFactoryTest.php | 30 +-- .../Tests/PhpPowerpointTest.php | 44 ++--- .../Tests/Reader/PowerPoint97Test.php | 139 +++++++++++++ .../Tests/Reader/SerializedTest.php | 28 +-- .../Tests/Shape/Chart/AxisTest.php | 136 +++++++++++++ .../Tests/Shape/Chart/LegendTest.php | 24 +-- .../Tests/Shape/Chart/PlotAreaTest.php | 111 +++++++++++ .../Tests/Shape/Chart/SeriesTest.php | 76 ++++---- .../Tests/Shape/Chart/TitleTest.php | 134 +++++++++++++ .../Tests/Shape/Chart/Type/AbstractTest.php | 18 +- .../Tests/Shape/Chart/Type/AreaTest.php | 24 +-- .../Tests/Shape/Chart/Type/Bar3DTest.php | 34 ++-- .../Tests/Shape/Chart/Type/BarTest.php | 34 ++-- .../Tests/Shape/Chart/Type/LineTest.php | 24 +-- .../Tests/Shape/Chart/Type/Pie3DTest.php | 26 +-- .../Tests/Shape/Chart/Type/PieTest.php | 24 +-- .../Tests/Shape/Chart/Type/ScatterTest.php | 24 +-- .../Tests/Shape/Chart/View3DTest.php | 105 ++++++++++ .../PhpPresentation/Tests/Shape/ChartTest.php | 65 +++++++ .../Tests/Shape/DrawingTest.php | 50 ++--- .../Tests/Shape/GroupTest.php | 38 ++-- .../Tests/Shape/HyperlinkTest.php | 32 +-- .../Tests/Shape/LineTest.php | 18 +- .../Tests/Shape/MemoryDrawingTest.php | 28 +-- .../Tests/Shape/RichText/BreakElementTest.php | 20 +- .../Tests/Shape/RichText/ParagraphTest.php | 151 ++++++++++++++ .../Tests/Shape/RichText/RunTest.php | 30 +-- .../Tests/Shape/RichText/TextElementTest.php | 30 +-- .../Tests/Shape/RichTextTest.php | 110 +++++------ .../Tests/Shape/Table/CellTest.php | 76 ++++---- .../Tests/Shape/Table/RowTest.php | 34 ++-- .../Tests/Shape/TableTest.php | 20 +- .../Tests/Slide/IteratorTest.php | 51 +++++ .../Tests/Slide/NoteTest.php | 32 +-- .../Tests/Slide/TransitionTest.php | 48 ++--- .../Tests/SlideTest.php | 46 ++--- .../Tests/Style/AlignmentTest.php | 52 ++--- .../Tests/Style/BorderTest.php | 44 ++--- .../Tests/Style/BordersTest.php | 32 +-- .../Tests/Style/BulletTest.php | 40 ++-- .../Tests/Style/ColorTest.php | 32 +-- .../Tests/Style/FillTest.php | 44 ++--- .../Tests/Style/FontTest.php | 86 ++++---- .../Tests/Style/ShadowTest.php | 54 ++--- .../ODPresentation/AbstractPartTest.php | 34 ++-- .../Writer/ODPresentation/ChartAreaTest.php | 44 ++--- .../Writer/ODPresentation/ChartBarTest.php | 42 ++-- .../Writer/ODPresentation/ChartsTest.php | 106 +++++----- .../Writer/ODPresentation/ContentTest.php | 184 +++++++++--------- .../Writer/ODPresentation/DrawingTest.php | 55 ++++++ .../Writer/ODPresentation/ManifestTest.php | 40 ++-- .../Writer/ODPresentation/StylesTest.php | 70 +++---- .../Tests/Writer/ODPresentationTest.php | 60 +++--- .../PowerPoint2007/AbstractPartTest.php | 30 +-- .../Writer/PowerPoint2007/ChartAreaTest.php | 34 ++-- .../Writer/PowerPoint2007/ChartBarTest.php | 34 ++-- .../Tests/Writer/PowerPoint2007/ChartTest.php | 148 +++++++------- .../Writer/PowerPoint2007/ContenTypesTest.php | 50 +++++ .../Writer/PowerPoint2007/DrawingTest.php | 55 ++++++ .../LayoutPack/TemplateBasedTest.php | 22 +-- .../Writer/PowerPoint2007/PptPropsTest.php | 30 +-- .../Tests/Writer/PowerPoint2007/SlideTest.php | 140 ++++++------- .../Tests/Writer/PowerPoint2007Test.php | 54 ++--- .../Tests/Writer/SerializedTest.php | 109 +++++++++++ .../Tests/_includes/TestHelperDOCX.php | 38 ++-- .../Tests/_includes/XmlDocument.php | 12 +- tests/bootstrap.php | 22 +-- tests/resources/files/serialized.phppt | Bin 11309 -> 14853 bytes ...rPointLogo.png => PhpPresentationLogo.png} | Bin 203 files changed, 4559 insertions(+), 4625 deletions(-) rename samples/{Sample_X2_Presentation.php => Sample_01_Complex.php} (84%) delete mode 100644 samples/Sample_X5_Templated.php rename samples/bootstrap/css/{phppowerpoint.css => phppresentation.css} (100%) rename src/{PhpPowerpoint => PhpPresentation}/AbstractShape.php (81%) rename src/{PhpPowerpoint => PhpPresentation}/Autoloader.php (72%) rename src/{PhpPowerpoint => PhpPresentation}/ComparableInterface.php (70%) rename src/{PhpPowerpoint => PhpPresentation}/DocumentLayout.php (92%) rename src/{PhpPowerpoint => PhpPresentation}/DocumentProperties.php (82%) rename src/{PhpPowerpoint => PhpPresentation}/GeometryCalculator.php (81%) rename src/{PhpPowerpoint => PhpPresentation}/HashTable.php (77%) rename src/{PhpPowerpoint => PhpPresentation}/IOFactory.php (61%) rename src/{PhpPowerpoint/PhpPowerpoint.php => PhpPresentation/PhpPresentation.php} (75%) rename src/{PhpPowerpoint => PhpPresentation}/Reader/PowerPoint97.php (98%) rename src/{PhpPowerpoint => PhpPresentation}/Reader/ReaderInterface.php (54%) rename src/{PhpPowerpoint => PhpPresentation}/Reader/Serialized.php (66%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/AbstractDrawing.php (83%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/Chart.php (67%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/Chart/Axis.php (77%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/Chart/Legend.php (76%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/Chart/PlotArea.php (77%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/Chart/Series.php (82%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/Chart/Title.php (77%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/Chart/Type/AbstractType.php (73%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/Chart/Type/AbstractTypeBar.php (79%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/Chart/Type/AbstractTypePie.php (70%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/Chart/Type/Area.php (57%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/Chart/Type/Bar.php (53%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/Chart/Type/Bar3D.php (53%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/Chart/Type/Line.php (57%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/Chart/Type/Pie.php (56%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/Chart/Type/Pie3D.php (56%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/Chart/Type/Scatter.php (57%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/Chart/View3D.php (84%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/Drawing.php (80%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/Group.php (79%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/Hyperlink.php (84%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/Line.php (64%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/MemoryDrawing.php (83%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/RichText.php (83%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/RichText/BreakElement.php (63%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/RichText/Paragraph.php (67%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/RichText/Run.php (60%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/RichText/TextElement.php (69%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/RichText/TextElementInterface.php (61%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/Table.php (71%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/Table/Cell.php (75%) rename src/{PhpPowerpoint => PhpPresentation}/Shape/Table/Row.php (77%) rename src/{PhpPowerpoint => PhpPresentation}/ShapeContainerInterface.php (59%) rename src/{PhpPowerpoint => PhpPresentation}/Slide.php (76%) rename src/{PhpPowerpoint => PhpPresentation}/Slide/Iterator.php (62%) rename src/{PhpPowerpoint => PhpPresentation}/Slide/Layout.php (67%) rename src/{PhpPowerpoint => PhpPresentation}/Slide/Note.php (82%) rename src/{PhpPowerpoint => PhpPresentation}/Slide/Transition.php (90%) rename src/{PhpPowerpoint => PhpPresentation}/Style/Alignment.php (87%) rename src/{PhpPowerpoint => PhpPresentation}/Style/Border.php (82%) rename src/{PhpPowerpoint => PhpPresentation}/Style/Borders.php (72%) rename src/{PhpPowerpoint => PhpPresentation}/Style/Bullet.php (89%) rename src/{PhpPowerpoint => PhpPresentation}/Style/Color.php (82%) rename src/{PhpPowerpoint => PhpPresentation}/Style/Fill.php (80%) rename src/{PhpPowerpoint => PhpPresentation}/Style/Font.php (84%) rename src/{PhpPowerpoint => PhpPresentation}/Style/Shadow.php (88%) rename src/{PhpPowerpoint => PhpPresentation}/Writer/ODPresentation.php (77%) rename src/{PhpPowerpoint => PhpPresentation}/Writer/ODPresentation/AbstractPart.php (57%) rename src/{PhpPowerpoint => PhpPresentation}/Writer/ODPresentation/Content.php (96%) rename src/{PhpPowerpoint/Writer/PowerPoint2007 => PhpPresentation/Writer/ODPresentation}/Drawing.php (57%) rename src/{PhpPowerpoint => PhpPresentation}/Writer/ODPresentation/Manifest.php (87%) rename src/{PhpPowerpoint => PhpPresentation}/Writer/ODPresentation/Meta.php (62%) rename src/{PhpPowerpoint => PhpPresentation}/Writer/ODPresentation/Mimetype.php (54%) rename src/{PhpPowerpoint => PhpPresentation}/Writer/ODPresentation/ObjectsChart.php (96%) rename src/{PhpPowerpoint => PhpPresentation}/Writer/ODPresentation/Styles.php (92%) rename src/{PhpPowerpoint => PhpPresentation}/Writer/PowerPoint2007.php (80%) rename src/{PhpPowerpoint => PhpPresentation}/Writer/PowerPoint2007/AbstractLayoutPack.php (89%) rename src/{PhpPowerpoint => PhpPresentation}/Writer/PowerPoint2007/AbstractPart.php (60%) rename src/{PhpPowerpoint => PhpPresentation}/Writer/PowerPoint2007/Chart.php (96%) rename src/{PhpPowerpoint => PhpPresentation}/Writer/PowerPoint2007/ContentTypes.php (89%) rename src/{PhpPowerpoint => PhpPresentation}/Writer/PowerPoint2007/DocProps.php (70%) rename src/{PhpPowerpoint/Writer/ODPresentation => PhpPresentation/Writer/PowerPoint2007}/Drawing.php (57%) rename src/{PhpPowerpoint => PhpPresentation}/Writer/PowerPoint2007/LayoutPack/PackDefault.php (99%) rename src/{PhpPowerpoint => PhpPresentation}/Writer/PowerPoint2007/LayoutPack/TemplateBased.php (93%) rename src/{PhpPowerpoint => PhpPresentation}/Writer/PowerPoint2007/PptProps.php (89%) rename src/{PhpPowerpoint => PhpPresentation}/Writer/PowerPoint2007/Presentation.php (71%) rename src/{PhpPowerpoint => PhpPresentation}/Writer/PowerPoint2007/Rels.php (94%) rename src/{PhpPowerpoint => PhpPresentation}/Writer/PowerPoint2007/Slide.php (96%) rename src/{PhpPowerpoint => PhpPresentation}/Writer/PowerPoint2007/Theme.php (66%) rename src/{PhpPowerpoint => PhpPresentation}/Writer/Serialized.php (52%) rename src/{PhpPowerpoint => PhpPresentation}/Writer/WriterInterface.php (54%) delete mode 100644 tests/PhpPowerpoint/Tests/AbstractShapeTest.php delete mode 100644 tests/PhpPowerpoint/Tests/Reader/PowerPoint97Test.php delete mode 100644 tests/PhpPowerpoint/Tests/Shape/Chart/AxisTest.php delete mode 100644 tests/PhpPowerpoint/Tests/Shape/Chart/PlotAreaTest.php delete mode 100644 tests/PhpPowerpoint/Tests/Shape/Chart/TitleTest.php delete mode 100644 tests/PhpPowerpoint/Tests/Shape/Chart/View3DTest.php delete mode 100644 tests/PhpPowerpoint/Tests/Shape/ChartTest.php delete mode 100644 tests/PhpPowerpoint/Tests/Shape/RichText/ParagraphTest.php delete mode 100644 tests/PhpPowerpoint/Tests/Slide/IteratorTest.php delete mode 100644 tests/PhpPowerpoint/Tests/Writer/ODPresentation/DrawingTest.php delete mode 100644 tests/PhpPowerpoint/Tests/Writer/PowerPoint2007/ContenTypesTest.php delete mode 100644 tests/PhpPowerpoint/Tests/Writer/PowerPoint2007/DrawingTest.php delete mode 100644 tests/PhpPowerpoint/Tests/Writer/SerializedTest.php create mode 100644 tests/PhpPresentation/Tests/AbstractShapeTest.php rename tests/{PhpPowerpoint => PhpPresentation}/Tests/AutoloaderTest.php (58%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/DocumentLayoutTest.php (55%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/DocumentPropertiesTest.php (75%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/HashTableTest.php (87%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/IOFactoryTest.php (52%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/PhpPowerpointTest.php (61%) create mode 100644 tests/PhpPresentation/Tests/Reader/PowerPoint97Test.php rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Reader/SerializedTest.php (63%) create mode 100644 tests/PhpPresentation/Tests/Shape/Chart/AxisTest.php rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Shape/Chart/LegendTest.php (55%) create mode 100644 tests/PhpPresentation/Tests/Shape/Chart/PlotAreaTest.php rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Shape/Chart/SeriesTest.php (53%) create mode 100644 tests/PhpPresentation/Tests/Shape/Chart/TitleTest.php rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Shape/Chart/Type/AbstractTest.php (55%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Shape/Chart/Type/AreaTest.php (56%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Shape/Chart/Type/Bar3DTest.php (54%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Shape/Chart/Type/BarTest.php (54%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Shape/Chart/Type/LineTest.php (56%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Shape/Chart/Type/Pie3DTest.php (57%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Shape/Chart/Type/PieTest.php (56%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Shape/Chart/Type/ScatterTest.php (56%) create mode 100644 tests/PhpPresentation/Tests/Shape/Chart/View3DTest.php create mode 100644 tests/PhpPresentation/Tests/Shape/ChartTest.php rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Shape/DrawingTest.php (61%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Shape/GroupTest.php (69%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Shape/HyperlinkTest.php (66%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Shape/LineTest.php (64%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Shape/MemoryDrawingTest.php (62%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Shape/RichText/BreakElementTest.php (58%) create mode 100644 tests/PhpPresentation/Tests/Shape/RichText/ParagraphTest.php rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Shape/RichText/RunTest.php (52%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Shape/RichText/TextElementTest.php (55%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Shape/RichTextTest.php (53%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Shape/Table/CellTest.php (52%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Shape/Table/RowTest.php (59%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Shape/TableTest.php (64%) create mode 100644 tests/PhpPresentation/Tests/Slide/IteratorTest.php rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Slide/NoteTest.php (63%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Slide/TransitionTest.php (50%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/SlideTest.php (53%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Style/AlignmentTest.php (64%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Style/BorderTest.php (55%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Style/BordersTest.php (57%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Style/BulletTest.php (60%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Style/ColorTest.php (60%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Style/FillTest.php (53%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Style/FontTest.php (53%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Style/ShadowTest.php (57%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Writer/ODPresentation/AbstractPartTest.php (64%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Writer/ODPresentation/ChartAreaTest.php (61%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Writer/ODPresentation/ChartBarTest.php (75%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Writer/ODPresentation/ChartsTest.php (81%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Writer/ODPresentation/ContentTest.php (85%) create mode 100644 tests/PhpPresentation/Tests/Writer/ODPresentation/DrawingTest.php rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Writer/ODPresentation/ManifestTest.php (55%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Writer/ODPresentation/StylesTest.php (76%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Writer/ODPresentationTest.php (57%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Writer/PowerPoint2007/AbstractPartTest.php (62%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Writer/PowerPoint2007/ChartAreaTest.php (63%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Writer/PowerPoint2007/ChartBarTest.php (72%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Writer/PowerPoint2007/ChartTest.php (81%) create mode 100644 tests/PhpPresentation/Tests/Writer/PowerPoint2007/ContenTypesTest.php create mode 100644 tests/PhpPresentation/Tests/Writer/PowerPoint2007/DrawingTest.php rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Writer/PowerPoint2007/LayoutPack/TemplateBasedTest.php (65%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Writer/PowerPoint2007/PptPropsTest.php (61%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Writer/PowerPoint2007/SlideTest.php (91%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/Writer/PowerPoint2007Test.php (62%) create mode 100644 tests/PhpPresentation/Tests/Writer/SerializedTest.php rename tests/{PhpPowerpoint => PhpPresentation}/Tests/_includes/TestHelperDOCX.php (54%) rename tests/{PhpPowerpoint => PhpPresentation}/Tests/_includes/XmlDocument.php (89%) rename tests/resources/images/{PHPPowerPointLogo.png => PhpPresentationLogo.png} (100%) diff --git a/.travis_shell_after_success.sh b/.travis_shell_after_success.sh index 487b0bbfe..a88b576e7 100644 --- a/.travis_shell_after_success.sh +++ b/.travis_shell_after_success.sh @@ -5,6 +5,7 @@ echo "TRAVIS_REPO_SLUG: $TRAVIS_REPO_SLUG" echo "TRAVIS_PHP_VERSION: $TRAVIS_PHP_VERSION" echo "TRAVIS_PULL_REQUEST: $TRAVIS_PULL_REQUEST" +##if [ "$TRAVIS_REPO_SLUG" == "PHPOffice/PHPPresentation" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_PHP_VERSION" == "5.5" ]; then if [ "$TRAVIS_REPO_SLUG" == "PHPOffice/PHPPowerPoint" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_PHP_VERSION" == "5.5" ]; then echo -e "Publishing PHPDoc...\n" @@ -15,6 +16,7 @@ if [ "$TRAVIS_REPO_SLUG" == "PHPOffice/PHPPowerPoint" ] && [ "$TRAVIS_PULL_REQUE cd $HOME git config --global user.email "travis@travis-ci.org" git config --global user.name "travis-ci" + ## git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/PHPOffice/PHPPresentation gh-pages > /dev/null git clone --quiet --branch=gh-pages https://${GH_TOKEN}@github.com/PHPOffice/PHPPowerPoint gh-pages > /dev/null cd gh-pages diff --git a/CHANGELOG.md b/CHANGELOG.md index 438031b59..b7d73698f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ ### Bugfix ### Changes +- PhpOffice\PhpPowerpoint becomes PhpOffice\PhpPresentation - @Progi1984 GH-25 - PhpOffice\PhpPowerpoint\Style\Font::setStriketrough has been removed : Use setStrikethrough - @Progi1984 - PhpOffice\PhpPowerpoint\AbstractShape::getSlide has been removed - @Progi1984 - PhpOffice\PhpPowerpoint\AbstractShape::setSlide has been removed - @Progi1984 diff --git a/LICENSE b/LICENSE index f5d35b7e8..e67de5a2f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,15 +1,15 @@ -PHPPowerPoint, a pure PHP library for writing presentations files. +PHPPresentation, a pure PHP library for writing presentations files. -Copyright (c) 2010-2014 PHPPowerPoint. +Copyright (c) 2010-2015 PHPPresentation. -PHPPowerPoint is free software: you can redistribute it and/or modify +PHPPresentation is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3 as published by the Free Software Foundation. -PHPPowerPoint is distributed in the hope that it will be useful, +PHPPresentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License version 3 for more details. You should have received a copy of the GNU Lesser General Public License version 3 -along with PHPPowerPoint. If not, see . +along with PHPPresentation. If not, see . diff --git a/README.md b/README.md index dd3ffe4d1..2293b7f8c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ![PHPPowerPoint](https://github.com/PHPOffice/PHPPowerPoint/raw/master/docs/images/PHPPowerPointLogo.png "PHPPowerPoint") +# ![PHPPresentation](https://github.com/PHPOffice/PHPPresentation/raw/master/docs/images/PHPPowerPointLogo.png "PHPPresentation") [![Latest Stable Version](https://poser.pugx.org/phpoffice/phppowerpoint/v/stable.png)](https://packagist.org/packages/phpoffice/phppowerpoint) [![Build Status](https://travis-ci.org/PHPOffice/PHPPowerPoint.svg?branch=master)](https://travis-ci.org/PHPOffice/PHPPowerPoint) @@ -9,11 +9,11 @@ [![Join the chat at https://gitter.im/PHPOffice/PHPPowerPoint](https://img.shields.io/badge/GITTER-join%20chat-green.svg)](https://gitter.im/PHPOffice/PHPPowerPoint) -PHPPowerPoint is a library written in pure PHP that provides a set of classes to write to different presentation file formats, i.e. Microsoft [Office Open XML](http://en.wikipedia.org/wiki/Office_Open_XML) (OOXML or OpenXML) or OASIS [Open Document Format for Office Applications](http://en.wikipedia.org/wiki/OpenDocument) (OpenDocument or ODF). +PHPPresentation is a library written in pure PHP that provides a set of classes to write to different presentation file formats, i.e. Microsoft [Office Open XML](http://en.wikipedia.org/wiki/Office_Open_XML) (OOXML or OpenXML) or OASIS [Open Document Format for Office Applications](http://en.wikipedia.org/wiki/OpenDocument) (OpenDocument or ODF). -PHPPowerPoint is an open source project licensed under the terms of [LGPL version 3](https://github.com/PHPOffice/PHPPowerPoint/blob/develop/COPYING.LESSER). PHPPowerPoint is aimed to be a high quality software product by incorporating [continuous integration](https://travis-ci.org/PHPOffice/PHPPowerPoint) and [unit testing](http://phpoffice.github.io/PHPPowerPoint/coverage/develop/). You can learn more about PHPPowerPoint by reading the [Developers' Documentation](http://phppowerpoint.readthedocs.org/) and the [API Documentation](http://phpoffice.github.io/PHPPowerPoint/docs/develop/). +PHPPresentation is an open source project licensed under the terms of [LGPL version 3](https://github.com/PHPOffice/PHPPresentation/blob/develop/COPYING.LESSER). PHPPresentation is aimed to be a high quality software product by incorporating [continuous integration](https://travis-ci.org/PHPOffice/PHPPowerPoint) and [unit testing](http://phpoffice.github.io/PHPPresentation/coverage/develop/). You can learn more about PHPPresentation by reading the [Developers' Documentation](http://phppowerpoint.readthedocs.org/) and the [API Documentation](http://phpoffice.github.io/PHPPresentation/docs/develop/). -Read more about PHPPowerPoint: +Read more about PHPPresentation: - [Features](#features) - [Requirements](#requirements) @@ -22,7 +22,7 @@ Read more about PHPPowerPoint: - [Known issues](#known-issues) - [Contributing](#contributing) - [Developers' Documentation](http://phppowerpoint.readthedocs.org/) -- [API Documentation](http://phpoffice.github.io/PHPPowerPoint/docs/master/) +- [API Documentation](http://phpoffice.github.io/PHPPresentation/docs/master/) ### Features @@ -40,7 +40,7 @@ Read more about PHPPowerPoint: ### Requirements -PHPPowerPoint requires the following: +PHPPresentation requires the following: - PHP 5.3+ - [Zip extension](http://php.net/manual/en/book.zip.php) @@ -49,42 +49,42 @@ PHPPowerPoint requires the following: ### Installation -It is recommended that you install the PHPPowerPoint library [through composer](http://getcomposer.org/). To do so, add +It is recommended that you install the PHPPresentation library [through composer](http://getcomposer.org/). To do so, add the following lines to your ``composer.json``. ```json { "require": { - "phpoffice/phppowerpoint": "dev-master" + "phpoffice/phppresentation": "dev-master" } } ``` -Alternatively, you can download the latest release from the [releases page](https://github.com/PHPOffice/PHPPowerPoint/releases). +Alternatively, you can download the latest release from the [releases page](https://github.com/PHPOffice/PHPPresentation/releases). In this case, you will have to register the autoloader. Register autoloading is required only if you do not use composer in your project. ```php -require_once 'path/to/PhpPowerpoint/src/PhpPowerpoint/Autoloader.php'; -\PhpOffice\PhpPowerpoint\Autoloader::register(); +require_once 'path/to/PhpPresentation/src/PhpPresentation/Autoloader.php'; +\PhpOffice\PhpPresentation\Autoloader::register(); ``` ## Getting started -The following is a basic usage example of the PHPPowerPoint library. +The following is a basic usage example of the PHPPresentation library. ```php -require_once 'src/PhpPowerpoint/Autoloader.php'; -\PhpOffice\PhpPowerpoint\Autoloader::register(); +require_once 'src/PhpPresentation/Autoloader.php'; +\PhpOffice\PhpPresentation\Autoloader::register(); -$objPHPPowerPoint = new PhpPowerpoint(); +$objPHPPowerPoint = new PhpPresentation(); // Create slide $currentSlide = $objPHPPowerPoint->getActiveSlide(); // Create a shape (drawing) $shape = $currentSlide->createDrawingShape(); -$shape->setName('PHPPowerPoint logo') - ->setDescription('PHPPowerPoint logo') +$shape->setName('PHPPresentation logo') + ->setDescription('PHPPresentation logo') ->setPath('./resources/phppowerpoint_logo.gif') ->setHeight(36) ->setOffsetX(10) @@ -100,7 +100,7 @@ $shape = $currentSlide->createRichTextShape() ->setOffsetX(170) ->setOffsetY(180); $shape->getActiveParagraph()->getAlignment()->setHorizontal( Alignment::HORIZONTAL_CENTER ); -$textRun = $shape->createTextRun('Thank you for using PHPPowerPoint!'); +$textRun = $shape->createTextRun('Thank you for using PHPPresentation!'); $textRun->getFont()->setBold(true) ->setSize(60) ->setColor( new Color( 'FFE06B20' ) ); @@ -111,14 +111,14 @@ $oWriterODP = IOFactory::createWriter($objPHPPowerPoint, 'ODPresentation'); $oWriterODP->save(__DIR__ . "/sample.odp"); ``` -More examples are provided in the [samples folder](samples/). You can also read the [Developers' Documentation](http://phppowerpoint.readthedocs.org/) and the [API Documentation](http://phpoffice.github.io/PHPPowerPoint/docs/master/) for more detail. +More examples are provided in the [samples folder](samples/). You can also read the [Developers' Documentation](http://phppowerpoint.readthedocs.org/) and the [API Documentation](http://phpoffice.github.io/PHPPresentation/docs/master/) for more detail. ## Contributing -We welcome everyone to contribute to PHPPowerPoint. Below are some of the things that you can do to contribute: +We welcome everyone to contribute to PHPPresentation. Below are some of the things that you can do to contribute: -- Read [our contributing guide](https://github.com/PHPOffice/PHPPowerPoint/blob/master/CONTRIBUTING.md) -- [Fork us](https://github.com/PHPOffice/PHPPowerPoint/fork) and [request a pull](https://github.com/PHPOffice/PHPPowerPoint/pulls) to the [develop](https://github.com/PHPOffice/PHPPowerPoint/tree/develop) branch -- Submit [bug reports or feature requests](https://github.com/PHPOffice/PHPPowerPoint/issues) to GitHub +- Read [our contributing guide](https://github.com/PHPOffice/PHPPresentation/blob/master/CONTRIBUTING.md) +- [Fork us](https://github.com/PHPOffice/PHPPresentation/fork) and [request a pull](https://github.com/PHPOffice/PHPPresentation/pulls) to the [develop](https://github.com/PHPOffice/PHPPresentation/tree/develop) branch +- Submit [bug reports or feature requests](https://github.com/PHPOffice/PHPPresentation/issues) to GitHub - Follow [@PHPOffice](https://twitter.com/PHPOffice) on Twitter diff --git a/composer.json b/composer.json index 5fcf68162..23a9b0d9f 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { - "name": "phpoffice/phppowerpoint", - "description": "PHPPowerPoint - Read, Create and Write Presentations documents in PHP", + "name": "phpoffice/phppresentation", + "description": "PHPPresentation - Read, Create and Write Presentations documents in PHP", "keywords": ["PHP","PowerPoint","LibreOffice","pptx","ppt","odp","presentations"], "homepage": "http://phpoffice.github.io", "type": "library", @@ -37,7 +37,7 @@ }, "autoload": { "psr-4": { - "PhpOffice\\PhpPowerpoint\\": "src/PhpPowerpoint/" + "PhpOffice\\PhpPresentation\\": "src/PhpPresentation/" } } } diff --git a/docs/conf.py b/docs/conf.py index 31a52a875..7b61950df 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# PhpPowerpoint documentation build configuration file, created by +# PhpPresentation documentation build configuration file, created by # sphinx-quickstart on Fri Mar 14 23:09:26 2014. # # This file is execfile()d with the current directory set to its containing dir. @@ -40,8 +40,8 @@ master_doc = 'index' # General information about the project. -project = u'PhpPowerpoint' -copyright = u'2014, PHPPowerPoint Contributors' +project = PhpPresentation' +copyright = u'2014, PHPPresentation Contributors' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -164,7 +164,7 @@ #html_file_suffix = None # Output file base name for HTML help builder. -htmlhelp_basename = 'PhpPowerpointdoc' +htmlhelp_basename = 'PhpPresentation' # -- Options for LaTeX output -------------------------------------------------- @@ -183,8 +183,8 @@ # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ('index', 'PhpPowerpoint.tex', u'PhpPowerpoint Documentation', - u'The PhpPowerpoint Team', 'manual'), + ('index', 'PhpPresentation.tex', u'PhpPresentation Documentation', + u'The PhpPresentation Team', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -213,8 +213,8 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - ('index', 'PhpPowerpoint', u'PhpPowerpoint Documentation', - [u'The PhpPowerpoint Team'], 1) + ('index', 'PhpPresentation', u'PhpPresentation Documentation', + [u'The PhpPresentation Team'], 1) ] # If true, show URL addresses after external links. @@ -227,8 +227,8 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'PhpPowerpoint', u'PhpPowerpoint Documentation', - u'The PhpPowerpoint Team', 'PhpPowerpoint', 'One line description of project.', + ('index', 'PhpPresentation', u'PhpPresentation Documentation', + u'The PhpPresentation Team', 'PhpPresentation', 'One line description of project.', 'Miscellaneous'), ] @@ -244,9 +244,9 @@ # -- Options for Epub output --------------------------------------------------- # Bibliographic Dublin Core info. -epub_title = u'PhpPowerpoint' -epub_author = u'The PhpPowerpoint Team' -epub_publisher = u'The PhpPowerpoint Team' +epub_title = u'PhpPresentation' +epub_author = u'The PhpPresentation Team' +epub_publisher = u'The PhpPresentation Team' epub_copyright = copyright # The language of the text. It defaults to the language option diff --git a/docs/faq.rst b/docs/faq.rst index 0445d9da8..a00c82170 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -11,13 +11,13 @@ find in PHPPowerPoint 0.1. The development in CodePlex is halted and switched to GitHub to allow more participation from the crowd. The more the merrier, right? -I’ve been running PHPPowerPoint from CodePlex flawlessly, but I can’t use the latest PHPPowerPoint from GitHub. Why? +I’ve been running PHPPowerPoint from CodePlex flawlessly, but I can’t use the latest PHPPresentation from GitHub. Why? -------------------------------------------------------------------------------------------------------------------- -PHPPowerPoint requires PHP 5.3+ since 0.2, while PHPPowerPoint 0.1 from CodePlex +PHPPresentation requires PHP 5.3+ since 0.2, while PHPPowerPoint 0.1 from CodePlex can run with PHP 5.2. There’s a lot of new features that we can get from PHP 5.3 and it’s been around since 2009! You should upgrade your PHP -version to use PHPPowerPoint 0.2+. +version to use PHPPresentation 0.2+. Why am I getting a class not found error? ----------------------------------------- @@ -31,7 +31,7 @@ without having to specify the full class name in your code: .. code-block:: php - use PhpOffice\PhpPowerpoint\Shape\MemoryDrawing as MemoryDrawing; + use PhpOffice\PhpPresentation\Shape\MemoryDrawing as MemoryDrawing; If you *have* followed the installation instructions and you *have* added the necessary ``use`` statements to your code, then maybe you are still @@ -47,3 +47,8 @@ translating the verbose class references into the correct file name and location. However, ``PHPPowerPoint`` now relies exclusively on the PSR-4 autoloader, so old code that may have been referencing the classes with the verbose class names will need to be updated accordingly. + +Why PHPPowerPoint become PHPPresentation ? +------------------------------------------ +As Roman Syroeshko noticed us, PowerPoint is a `trademark `__. +For avoiding any problems with Microsoft, we decide to change the name to a more logic name, with our panel of readers/writers. \ No newline at end of file diff --git a/docs/general.rst b/docs/general.rst index 71e61af8e..6cf0b5b54 100644 --- a/docs/general.rst +++ b/docs/general.rst @@ -6,25 +6,25 @@ General usage Basic example ------------- -The following is a basic example of the PHPPowerPoint library. More examples +The following is a basic example of the PHPPresentation library. More examples are provided in the `samples -folder `__. +folder `__. .. code-block:: php - require_once 'src/PhpPowerpoint/Autoloader.php'; - \PhpOffice\PhpPowerpoint\Autoloader::register(); + require_once 'src/PhpPresentation/Autoloader.php'; + \PhpOffice\PhpPresentation\Autoloader::register(); - $objPHPPowerPoint = new PhpPowerpoint(); + $objPHPPresentation = new PhpPresentation(); // Create slide - $currentSlide = $objPHPPowerPoint->getActiveSlide(); + $currentSlide = $objPHPPresentation->getActiveSlide(); // Create a shape (drawing) $shape = $currentSlide->createDrawingShape(); - $shape->setName('PHPPowerPoint logo') - ->setDescription('PHPPowerPoint logo') - ->setPath('./resources/phppowerpoint_logo.gif') + $shape->setName('PHPPresentation logo') + ->setDescription('PHPPresentation logo') + ->setPath('./resources/phppresentation_logo.gif') ->setHeight(36) ->setOffsetX(10) ->setOffsetY(10); @@ -39,14 +39,14 @@ folder `__. ->setOffsetX(170) ->setOffsetY(180); $shape->getActiveParagraph()->getAlignment()->setHorizontal( Alignment::HORIZONTAL_CENTER ); - $textRun = $shape->createTextRun('Thank you for using PHPPowerPoint!'); + $textRun = $shape->createTextRun('Thank you for using PHPPresentation!'); $textRun->getFont()->setBold(true) ->setSize(60) ->setColor( new Color( 'FFE06B20' ) ); - $oWriterPPTX = IOFactory::createWriter($objPHPPowerPoint, 'PowerPoint2007'); + $oWriterPPTX = IOFactory::createWriter($objPHPPresentation, 'PowerPoint2007'); $oWriterPPTX->save(__DIR__ . "/sample.pptx"); - $oWriterODP = IOFactory::createWriter($objPHPPowerPoint, 'ODPresentation'); + $oWriterODP = IOFactory::createWriter($objPHPPresentation, 'ODPresentation'); $oWriterODP->save(__DIR__ . "/sample.odp"); Document information @@ -57,7 +57,7 @@ name. Use the following functions: .. code-block:: php - $properties = $phpPowerpoint->getProperties(); + $properties = $objPHPPresentation->getProperties(); $properties->setCreator('My name'); $properties->setCompany('My factory'); $properties->setTitle('My title'); diff --git a/docs/index.rst b/docs/index.rst index c59e73ac9..6a4465cf6 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,14 +1,14 @@ -.. PHPPowerPoint documentation master file, created by +.. PHPPresentation documentation master file, created by sphinx-quickstart on Fri Mar 14 23:09:26 2014. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -Welcome to PHPPowerPoint's documentation +Welcome to PHPPresentation's documentation ======================================== -|PHPPowerPoint| +|PHPPresentation| -PHPPowerPoint is a library written in pure PHP that provides a set of classes to write to different presentation file formats, i.e. OpenXML (.pptx) and OpenDocument (.odp). PHPPowerPoint is an open source project licensed under LGPL. +PHPPresentation is a library written in pure PHP that provides a set of classes to write to different presentation file formats, i.e. OpenXML (.pptx) and OpenDocument (.odp). PHPPresentation is an open source project licensed under LGPL. .. toctree:: :maxdepth: 2 @@ -41,4 +41,4 @@ Indices and tables * :ref:`modindex` * :ref:`search` -.. |PHPPowerPoint| image:: images/phppowerpoint_logo.gif +.. |PHPPresentation| image:: images/phppowerpoint_logo.gif diff --git a/docs/installing.rst b/docs/installing.rst index df43955f2..9618828a8 100644 --- a/docs/installing.rst +++ b/docs/installing.rst @@ -21,7 +21,7 @@ Optional PHP extensions: Installation ------------ -There are two ways to install PHPPowerPoint, i.e. via +There are two ways to install PHPPresentation, i.e. via `Composer `__ or manually by downloading the library. @@ -35,28 +35,28 @@ To install via Composer, add the following lines to your { "require": { - "phpoffice/phppowerpoint": "dev-master" + "phpoffice/phppresentation": "dev-master" } } Manual install ~~~~~~~~~~~~~~ -To install manually, `download PHPPowerPoint package from -github `__. +To install manually, `download PHPPresentation package from +github `__. Extract the package and put the contents to your machine. To use the -library, include ``src/PhpPowerpoint/Autoloader.php`` in your script and +library, include ``src/PhpPresentation/Autoloader.php`` in your script and invoke ``Autoloader::register``. .. code-block:: php - require_once '/path/to/src/PhpPowerpoint/Autoloader.php'; - \PhpOffice\PhpPowerpoint\Autoloader::register(); + require_once '/path/to/src/PhpPresentation/Autoloader.php'; + \PhpOffice\PhpPresentation\Autoloader::register(); Using samples ------------- After installation, you can browse and use the samples that we've provided, either by command line or using browser. If you can access -your PHPPowerPoint library folder using browser, point your browser to the -``samples`` folder, e.g. ``http://localhost/PhpPowerpoint/samples/``. +your PHPPresentation library folder using browser, point your browser to the +``samples`` folder, e.g. ``http://localhost/PhpPresentation/samples/``. diff --git a/docs/intro.rst b/docs/intro.rst index 995ffdcef..dc45b10be 100644 --- a/docs/intro.rst +++ b/docs/intro.rst @@ -3,19 +3,19 @@ Introduction ============ -PHPPowerPoint is a library written in pure PHP that provides a set of +PHPPresentation is a library written in pure PHP that provides a set of classes to write to different presentation file formats, i.e. Microsoft `Office Open XML ` (.pptx) and OASIS `Open Document Format for Office Applications `__ (.odp). -PHPPowerPoint is an open source project licensed under the terms of `LGPL -version 3 `__. -PHPPowerPoint is aimed to be a high quality software product by incorporating -`continuous integration `__ and -`unit testing `__. -You can learn more about PHPPowerPoint by reading this Developers' -Documentation and the `API Documentation `__. +PHPPresentation is an open source project licensed under the terms of `LGPL +version 3 `__. +PHPPresentation is aimed to be a high quality software product by incorporating +`continuous integration `__ and +`unit testing `__. +You can learn more about PHPPresentation by reading this Developers' +Documentation and the `API Documentation `__. Features -------- @@ -100,15 +100,15 @@ Readers Contributing ------------ -We welcome everyone to contribute to PHPPowerPoint. Below are some of the +We welcome everyone to contribute to PHPPresentation. Below are some of the things that you can do to contribute: - Read `our contributing - guide `__ -- `Fork us `__ and `request - a pull `__ to the - `develop `__ + guide `__ +- `Fork us `__ and `request + a pull `__ to the + `develop `__ branch - Submit `bug reports or feature - requests `__ to GitHub + requests `__ to GitHub - Follow `@PHPOffice `__ on Twitter diff --git a/docs/slides.rst b/docs/slides.rst index 4f244354d..9d7858730 100644 --- a/docs/slides.rst +++ b/docs/slides.rst @@ -3,4 +3,4 @@ Slides ====== -Slides are pages in a presentation. Slides are stored as a zero based array in ``PHPPowerPoint`` object. Use ``createSlide`` to create a new slide and retrieve the slide for other operation such as creating shapes for that slide. +Slides are pages in a presentation. Slides are stored as a zero based array in ``PHPPresentation`` object. Use ``createSlide`` to create a new slide and retrieve the slide for other operation such as creating shapes for that slide. diff --git a/phpmd.xml.dist b/phpmd.xml.dist index 87a53c279..33179ad87 100644 --- a/phpmd.xml.dist +++ b/phpmd.xml.dist @@ -1,5 +1,5 @@ - - - ./tests/PhpPowerpoint + + ./tests/PhpPresentation diff --git a/samples/Sample_X2_Presentation.php b/samples/Sample_01_Complex.php similarity index 84% rename from samples/Sample_X2_Presentation.php rename to samples/Sample_01_Complex.php index b8f252933..a5b0b7fa8 100644 --- a/samples/Sample_X2_Presentation.php +++ b/samples/Sample_01_Complex.php @@ -1,22 +1,22 @@ getProperties()->setCreator('PHPOffice') - ->setLastModifiedBy('PHPPowerPoint Team') +$objPHPPresentation->getProperties()->setCreator('PHPOffice') + ->setLastModifiedBy('PHPPresentation Team') ->setTitle('Sample 02 Title') ->setSubject('Sample 02 Subject') ->setDescription('Sample 02 Description') @@ -25,11 +25,11 @@ // Remove first slide echo date('H:i:s') . ' Remove first slide'.EOL; -$objPHPPowerPoint->removeSlideByIndex(0); +$objPHPPresentation->removeSlideByIndex(0); // Create templated slide echo date('H:i:s') . ' Create templated slide'.EOL; -$currentSlide = createTemplatedSlide($objPHPPowerPoint); // local function +$currentSlide = createTemplatedSlide($objPHPPresentation); // local function // Create a shape (text) echo date('H:i:s') . ' Create a shape (rich text)'.EOL; @@ -47,7 +47,7 @@ $shape->createBreak(); -$textRun = $shape->createTextRun('PHPPowerPoint'); +$textRun = $shape->createTextRun('PHPPresentation'); $textRun->getFont()->setBold(true); $textRun->getFont()->setSize(60); $textRun->getFont()->setColor($colorBlack); @@ -55,7 +55,7 @@ // Create templated slide echo date('H:i:s') . ' Create templated slide'.EOL; -$currentSlide = createTemplatedSlide($objPHPPowerPoint); // local function +$currentSlide = createTemplatedSlide($objPHPPresentation); // local function // Create a shape (text) echo date('H:i:s') . ' Create a shape (rich text)'.EOL; @@ -66,7 +66,7 @@ ->setOffsetY(50); $shape->getActiveParagraph()->getAlignment()->setHorizontal(Alignment::HORIZONTAL_LEFT); -$textRun = $shape->createTextRun('What is PHPPowerPoint?'); +$textRun = $shape->createTextRun('What is PHPPresentation?'); $textRun->getFont()->setBold(true) ->setSize(48) ->setColor($colorBlack); @@ -93,7 +93,7 @@ // Create templated slide echo date('H:i:s') . ' Create templated slide'.EOL; -$currentSlide = createTemplatedSlide($objPHPPowerPoint); // local function +$currentSlide = createTemplatedSlide($objPHPPresentation); // local function // Create a shape (text) echo date('H:i:s') . ' Create a shape (rich text)'.EOL; @@ -138,14 +138,14 @@ $shape->createParagraph()->getAlignment()->setLevel(1) ->setMarginLeft(75) ->setIndent(-25); -$shape->createTextRun('PowerPoint 2007'); +$shape->createTextRun('PHPPresentation 2007'); $shape->createParagraph()->createTextRun('Serialized'); $shape->createParagraph()->createTextRun('... (more to come) ...'); // Create templated slide echo date('H:i:s') . ' Create templated slide'.EOL; -$currentSlide = createTemplatedSlide($objPHPPowerPoint); // local function +$currentSlide = createTemplatedSlide($objPHPPresentation); // local function // Create a shape (text) echo date('H:i:s') . ' Create a shape (rich text)'.EOL; @@ -176,14 +176,14 @@ $shape->createBreak(); -$textRun = $shape->createTextRun('https://github.com/PHPOffice/PHPPowerPoint/'); +$textRun = $shape->createTextRun('https://github.com/PHPOffice/PHPPresentation/'); $textRun->getFont()->setSize(32) ->setColor($colorBlack); -$textRun->getHyperlink()->setUrl('https://github.com/PHPOffice/PHPPowerPoint/') - ->setTooltip('PHPPowerPoint'); +$textRun->getHyperlink()->setUrl('https://github.com/PHPOffice/PHPPresentation/') + ->setTooltip('PHPPresentation'); // Save file -echo write($objPHPPowerPoint, basename(__FILE__, '.php'), $writers); +echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers); if (!CLI) { include_once 'Sample_Footer.php'; } diff --git a/samples/Sample_01_Simple.php b/samples/Sample_01_Simple.php index bc6440ce1..c99bb867b 100644 --- a/samples/Sample_01_Simple.php +++ b/samples/Sample_01_Simple.php @@ -2,18 +2,18 @@ include_once 'Sample_Header.php'; -use PhpOffice\PhpPowerpoint\PhpPowerpoint; -use PhpOffice\PhpPowerpoint\Style\Alignment; -use PhpOffice\PhpPowerpoint\Style\Color; +use PhpOffice\PhpPresentation\PhpPresentation; +use PhpOffice\PhpPresentation\Style\Alignment; +use PhpOffice\PhpPresentation\Style\Color; -// Create new PHPPowerPoint object -echo date('H:i:s') . ' Create new PHPPowerPoint object' . EOL; -$objPHPPowerPoint = new PhpPowerpoint(); +// Create new PHPPresentation object +echo date('H:i:s') . ' Create new PHPPresentation object' . EOL; +$objPHPPresentation = new PhpPresentation(); // Set properties echo date('H:i:s') . ' Set properties'.EOL; -$objPHPPowerPoint->getProperties()->setCreator('PHPOffice') - ->setLastModifiedBy('PHPPowerPoint Team') +$objPHPPresentation->getProperties()->setCreator('PHPOffice') + ->setLastModifiedBy('PHPPresentation Team') ->setTitle('Sample 01 Title') ->setSubject('Sample 01 Subject') ->setDescription('Sample 01 Description') @@ -22,13 +22,13 @@ // Create slide echo date('H:i:s') . ' Create slide'.EOL; -$currentSlide = $objPHPPowerPoint->getActiveSlide(); +$currentSlide = $objPHPPresentation->getActiveSlide(); // Create a shape (drawing) echo date('H:i:s') . ' Create a shape (drawing)'.EOL; $shape = $currentSlide->createDrawingShape(); -$shape->setName('PHPPowerPoint logo') - ->setDescription('PHPPowerPoint logo') +$shape->setName('PHPPresentation logo') + ->setDescription('PHPPresentation logo') ->setPath('./resources/phppowerpoint_logo.gif') ->setHeight(36) ->setOffsetX(10) @@ -36,7 +36,7 @@ $shape->getShadow()->setVisible(true) ->setDirection(45) ->setDistance(10); -$shape->getHyperlink()->setUrl('https://github.com/PHPOffice/PHPPowerPoint/')->setTooltip('PHPPowerPoint'); +$shape->getHyperlink()->setUrl('https://github.com/PHPOffice/PHPPresentation/')->setTooltip('PHPPresentation'); // Create a shape (text) echo date('H:i:s') . ' Create a shape (rich text)'.EOL; @@ -46,13 +46,13 @@ ->setOffsetX(170) ->setOffsetY(180); $shape->getActiveParagraph()->getAlignment()->setHorizontal( Alignment::HORIZONTAL_CENTER ); -$textRun = $shape->createTextRun('Thank you for using PHPPowerPoint!'); +$textRun = $shape->createTextRun('Thank you for using PHPPresentation!'); $textRun->getFont()->setBold(true) ->setSize(60) ->setColor( new Color( 'FFE06B20' ) ); // Save file -echo write($objPHPPowerPoint, basename(__FILE__, '.php'), $writers); +echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers); if (!CLI) { include_once 'Sample_Footer.php'; } diff --git a/samples/Sample_02_Serialized.php b/samples/Sample_02_Serialized.php index e3ffbb6df..1d9b3b60e 100644 --- a/samples/Sample_02_Serialized.php +++ b/samples/Sample_02_Serialized.php @@ -2,19 +2,19 @@ include_once 'Sample_Header.php'; -use PhpOffice\PhpPowerpoint\PhpPowerpoint; -use PhpOffice\PhpPowerpoint\Style\Alignment; -use PhpOffice\PhpPowerpoint\Style\Color; -use PhpOffice\PhpPowerpoint\IOFactory; +use PhpOffice\PhpPresentation\PhpPresentation; +use PhpOffice\PhpPresentation\Style\Alignment; +use PhpOffice\PhpPresentation\Style\Color; +use PhpOffice\PhpPresentation\IOFactory; -// Create new PHPPowerPoint object -echo date('H:i:s') . ' Create new PHPPowerPoint object'.EOL; -$objPHPPowerPoint = new PhpPowerpoint(); +// Create new PHPPresentation object +echo date('H:i:s') . ' Create new PHPPresentation object'.EOL; +$objPHPPresentation = new PhpPresentation(); // Set properties echo date('H:i:s') . ' Set properties'.EOL; -$objPHPPowerPoint->getProperties()->setCreator('PHPOffice') - ->setLastModifiedBy('PHPPowerPoint Team') +$objPHPPresentation->getProperties()->setCreator('PHPOffice') + ->setLastModifiedBy('PHPPresentation Team') ->setTitle('Sample 03 Title') ->setSubject('Sample 03 Subject') ->setDescription('Sample 03 Description') @@ -23,13 +23,13 @@ // Create slide echo date('H:i:s') . ' Create slide'.EOL; -$currentSlide = $objPHPPowerPoint->getActiveSlide(); +$currentSlide = $objPHPPresentation->getActiveSlide(); // Create a shape (drawing) echo date('H:i:s') . ' Create a shape (drawing)'.EOL; $shape = $currentSlide->createDrawingShape(); -$shape->setName('PHPPowerPoint logo') - ->setDescription('PHPPowerPoint logo') +$shape->setName('PHPPresentation logo') + ->setDescription('PHPPresentation logo') ->setPath('./resources/phppowerpoint_logo.gif') ->setHeight(36) ->setOffsetX(10) @@ -46,7 +46,7 @@ ->setOffsetX(170) ->setOffsetY(180); $shape->getActiveParagraph()->getAlignment()->setHorizontal( Alignment::HORIZONTAL_CENTER ); -$textRun = $shape->createTextRun('Thank you for using PHPPowerPoint!'); +$textRun = $shape->createTextRun('Thank you for using PHPPresentation!'); $textRun->getFont()->setBold(true) ->setSize(60) ->setColor( new Color( 'FFE06B20' ) ); @@ -54,15 +54,15 @@ // Save serialized file $basename = basename(__FILE__, '.php'); echo date('H:i:s') . ' Write to serialized format'.EOL; -$objWriter = IOFactory::createWriter($objPHPPowerPoint, 'Serialized'); +$objWriter = IOFactory::createWriter($objPHPPresentation, 'Serialized'); $objWriter->save('results/'.basename(__FILE__, '.php').'.phppt'); // Read from serialized file echo date('H:i:s') . ' Read from serialized format'.EOL; -$objPHPPowerPointLoaded = IOFactory::load('results/'.basename(__FILE__, '.php').'.phppt'); +$objPHPPresentationLoaded = IOFactory::load('results/'.basename(__FILE__, '.php').'.phppt'); // Save file -echo write($objPHPPowerPointLoaded, basename(__FILE__, '.php'), $writers); +echo write($objPHPPresentationLoaded, basename(__FILE__, '.php'), $writers); if (!CLI) { include_once 'Sample_Footer.php'; } diff --git a/samples/Sample_03_Image.php b/samples/Sample_03_Image.php index 0b00ed0fc..964a25095 100644 --- a/samples/Sample_03_Image.php +++ b/samples/Sample_03_Image.php @@ -2,26 +2,26 @@ include_once 'Sample_Header.php'; -use PhpOffice\PhpPowerpoint\PhpPowerpoint; -use PhpOffice\PhpPowerpoint\Shape\Drawing; -use PhpOffice\PhpPowerpoint\Shape\MemoryDrawing; +use PhpOffice\PhpPresentation\PhpPresentation; +use PhpOffice\PhpPresentation\Shape\Drawing; +use PhpOffice\PhpPresentation\Shape\MemoryDrawing; -// Create new PHPPowerPoint object -echo date('H:i:s') . ' Create new PHPPowerPoint object'.EOL; -$objPHPPowerPoint = new PhpPowerpoint(); +// Create new PHPPresentation object +echo date('H:i:s') . ' Create new PHPPresentation object'.EOL; +$objPHPPresentation = new PhpPresentation(); // Create slide echo date('H:i:s') . ' Create slide'.EOL; -$currentSlide = $objPHPPowerPoint->getActiveSlide(); +$currentSlide = $objPHPPresentation->getActiveSlide(); // Generate an image echo date('H:i:s') . ' Generate an image'.EOL; $gdImage = @imagecreatetruecolor(140, 20) or die('Cannot Initialize new GD image stream'); $textColor = imagecolorallocate($gdImage, 255, 255, 255); -imagestring($gdImage, 1, 5, 5, 'Created with PHPPowerPoint', $textColor); +imagestring($gdImage, 1, 5, 5, 'Created with PHPPresentation', $textColor); // Add a generated drawing to the slide -echo date('H:i:s') . ' Add a drawing to the worksheet'.EOL; +echo date('H:i:s') . ' Add a drawing to the slide'.EOL; $shape = new MemoryDrawing(); $shape->setName('Sample image') ->setDescription('Sample image') @@ -35,8 +35,8 @@ // Add a file drawing (GIF) to the slide $shape = new Drawing(); -$shape->setName('PHPPowerPoint logo') - ->setDescription('PHPPowerPoint logo') +$shape->setName('PHPPresentation logo') + ->setDescription('PHPPresentation logo') ->setPath('./resources/phppowerpoint_logo.gif') ->setHeight(36) ->setOffsetX(10) @@ -44,7 +44,7 @@ $currentSlide->addShape($shape); // Save file -echo write($objPHPPowerPoint, basename(__FILE__, '.php'), $writers); +echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers); if (!CLI) { include_once 'Sample_Footer.php'; } diff --git a/samples/Sample_04_Table.php b/samples/Sample_04_Table.php index f1b3c5b24..4aa2fa2e5 100644 --- a/samples/Sample_04_Table.php +++ b/samples/Sample_04_Table.php @@ -2,19 +2,19 @@ include_once 'Sample_Header.php'; -use PhpOffice\PhpPowerpoint\PhpPowerpoint; -use PhpOffice\PhpPowerpoint\Style\Border; -use PhpOffice\PhpPowerpoint\Style\Color; -use PhpOffice\PhpPowerpoint\Style\Fill; +use PhpOffice\PhpPresentation\PhpPresentation; +use PhpOffice\PhpPresentation\Style\Border; +use PhpOffice\PhpPresentation\Style\Color; +use PhpOffice\PhpPresentation\Style\Fill; -// Create new PHPPowerPoint object -echo date('H:i:s') . ' Create new PHPPowerPoint object'.EOL; -$objPHPPowerPoint = new PhpPowerpoint(); +// Create new PHPPresentation object +echo date('H:i:s') . ' Create new PHPPresentation object'.EOL; +$objPHPPresentation = new PhpPresentation(); // Set properties echo date('H:i:s') . ' Set properties'.EOL; -$objPHPPowerPoint->getProperties()->setCreator('PHPOffice') - ->setLastModifiedBy('PHPPowerPoint Team') +$objPHPPresentation->getProperties()->setCreator('PHPOffice') + ->setLastModifiedBy('PHPPresentation Team') ->setTitle('Sample 06 Title') ->setSubject('Sample 06 Subject') ->setDescription('Sample 06 Description') @@ -23,11 +23,11 @@ // Remove first slide echo date('H:i:s') . ' Remove first slide'.EOL; -$objPHPPowerPoint->removeSlideByIndex(0); +$objPHPPresentation->removeSlideByIndex(0); // Create slide echo date('H:i:s') . ' Create slide'.EOL; -$currentSlide = createTemplatedSlide($objPHPPowerPoint); +$currentSlide = createTemplatedSlide($objPHPPresentation); // Create a shape (table) echo date('H:i:s') . ' Create a shape (table)'.EOL; @@ -97,7 +97,7 @@ ->setEndColor(new Color('FFE06B20')); $cellC1 = $row->nextCell(); $textRunC1 = $cellC1->createTextRun('Link'); -$textRunC1->getHyperlink()->setUrl('https://github.com/PHPOffice/PHPPowerPoint/')->setTooltip('PHPPowerPoint'); +$textRunC1->getHyperlink()->setUrl('https://github.com/PHPOffice/PHPPresentation/')->setTooltip('PHPPresentation'); $cellC2 = $row->nextCell(); $textRunC2 = $cellC2->createTextRun('RichText with'); $textRunC2->getFont()->setBold(true); @@ -116,7 +116,7 @@ $textRunC3->getHyperlink()->setUrl('https://google.com')->setTooltip('Google'); // Save file -echo write($objPHPPowerPoint, basename(__FILE__, '.php'), $writers); +echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers); if (!CLI) { include_once 'Sample_Footer.php'; } \ No newline at end of file diff --git a/samples/Sample_05_Chart.php b/samples/Sample_05_Chart.php index 5ca0bb950..cb3547b11 100644 --- a/samples/Sample_05_Chart.php +++ b/samples/Sample_05_Chart.php @@ -2,23 +2,23 @@ include_once 'Sample_Header.php'; -use PhpOffice\PhpPowerpoint\PhpPowerpoint; -use PhpOffice\PhpPowerpoint\Shape\Chart\Type\Area; -use PhpOffice\PhpPowerpoint\Shape\Chart\Type\Bar; -use PhpOffice\PhpPowerpoint\Shape\Chart\Type\Bar3D; -use PhpOffice\PhpPowerpoint\Shape\Chart\Type\Line; -use PhpOffice\PhpPowerpoint\Shape\Chart\Type\Pie; -use PhpOffice\PhpPowerpoint\Shape\Chart\Type\Pie3D; -use PhpOffice\PhpPowerpoint\Shape\Chart\Type\Scatter; -use PhpOffice\PhpPowerpoint\Shape\Chart\Series; -use PhpOffice\PhpPowerpoint\Style\Alignment; -use PhpOffice\PhpPowerpoint\Style\Border; -use PhpOffice\PhpPowerpoint\Style\Color; -use PhpOffice\PhpPowerpoint\Style\Fill; -use PhpOffice\PhpPowerpoint\Style\Shadow; -use PhpOffice\PhpPowerpoint\Style\PhpOffice\PhpPowerpoint\Style; - -function fnSlide_Area(PhpPowerpoint $objPHPPowerPoint) { +use PhpOffice\PhpPresentation\PhpPresentation; +use PhpOffice\PhpPresentation\Shape\Chart\Type\Area; +use PhpOffice\PhpPresentation\Shape\Chart\Type\Bar; +use PhpOffice\PhpPresentation\Shape\Chart\Type\Bar3D; +use PhpOffice\PhpPresentation\Shape\Chart\Type\Line; +use PhpOffice\PhpPresentation\Shape\Chart\Type\Pie; +use PhpOffice\PhpPresentation\Shape\Chart\Type\Pie3D; +use PhpOffice\PhpPresentation\Shape\Chart\Type\Scatter; +use PhpOffice\PhpPresentation\Shape\Chart\Series; +use PhpOffice\PhpPresentation\Style\Alignment; +use PhpOffice\PhpPresentation\Style\Border; +use PhpOffice\PhpPresentation\Style\Color; +use PhpOffice\PhpPresentation\Style\Fill; +use PhpOffice\PhpPresentation\Style\Shadow; +use PhpOffice\PhpPresentation\Style\PhpOffice\PhpPresentation\Style; + +function fnSlide_Area(PhpPresentation $objPHPPresentation) { global $oFill; global $oShadow; @@ -36,7 +36,7 @@ function fnSlide_Area(PhpPowerpoint $objPHPPowerPoint) { // Create templated slide echo EOL . date('H:i:s') . ' Create templated slide' . EOL; - $currentSlide = createTemplatedSlide($objPHPPowerPoint); + $currentSlide = createTemplatedSlide($objPHPPresentation); // Create a line chart (that should be inserted in a shape) echo date('H:i:s') . ' Create a area chart (that should be inserted in a chart shape)' . EOL; @@ -51,11 +51,11 @@ function fnSlide_Area(PhpPowerpoint $objPHPPowerPoint) { echo date('H:i:s') . ' Create a shape (chart)' . EOL; $shape = $currentSlide->createChartShape(); $shape->getTitle()->setVisible(false); - $shape->setName('PHPPowerPoint Daily Downloads')->setResizeProportional(false)->setHeight(550)->setWidth(700)->setOffsetX(120)->setOffsetY(80); + $shape->setName('PHPPresentation Daily Downloads')->setResizeProportional(false)->setHeight(550)->setWidth(700)->setOffsetX(120)->setOffsetY(80); $shape->setShadow($oShadow); $shape->setFill($oFill); $shape->getBorder()->setLineStyle(Border::LINE_SINGLE); - $shape->getTitle()->setText('PHPPowerPoint Daily Downloads'); + $shape->getTitle()->setText('PHPPresentation Daily Downloads'); $shape->getTitle()->getFont()->setItalic(true); $shape->getPlotArea()->setType($areaChart); $shape->getView3D()->setRotationX(30); @@ -64,13 +64,13 @@ function fnSlide_Area(PhpPowerpoint $objPHPPowerPoint) { $shape->getLegend()->getFont()->setItalic(true); } -function fnSlide_Bar(PhpPowerpoint $objPHPPowerPoint) { +function fnSlide_Bar(PhpPresentation $objPHPPresentation) { global $oFill; global $oShadow; // Create templated slide echo EOL.date('H:i:s') . ' Create templated slide'.EOL; - $currentSlide = createTemplatedSlide($objPHPPowerPoint); + $currentSlide = createTemplatedSlide($objPHPPresentation); // Generate sample data for first chart echo date('H:i:s') . ' Generate sample data for chart'.EOL; @@ -95,7 +95,7 @@ function fnSlide_Bar(PhpPowerpoint $objPHPPowerPoint) { // Create a shape (chart) echo date('H:i:s') . ' Create a shape (chart)'.EOL; $shape = $currentSlide->createChartShape(); - $shape->setName('PHPPowerPoint Monthly Downloads') + $shape->setName('PHPPresentation Monthly Downloads') ->setResizeProportional(false) ->setHeight(550) ->setWidth(700) @@ -104,7 +104,7 @@ function fnSlide_Bar(PhpPowerpoint $objPHPPowerPoint) { $shape->setShadow($oShadow); $shape->setFill($oFill); $shape->getBorder()->setLineStyle(Border::LINE_SINGLE); - $shape->getTitle()->setText('PHPPowerPoint Monthly Downloads'); + $shape->getTitle()->setText('PHPPresentation Monthly Downloads'); $shape->getTitle()->getFont()->setItalic(true); $shape->getTitle()->getAlignment()->setHorizontal(Alignment::HORIZONTAL_RIGHT); $shape->getPlotArea()->getAxisX()->setTitle('Month'); @@ -114,23 +114,23 @@ function fnSlide_Bar(PhpPowerpoint $objPHPPowerPoint) { $shape->getLegend()->getFont()->setItalic(true); } -function fnSlide_BarHorizontal(PhpPowerpoint $objPHPPowerPoint) { +function fnSlide_BarHorizontal(PhpPresentation $objPHPPresentation) { global $oFill; global $oShadow; // Create a bar chart (that should be inserted in a shape) echo date('H:i:s') . ' Create a horizontal bar chart (that should be inserted in a chart shape) '.EOL; - $barChartHorz = clone $objPHPPowerPoint->getSlide(1)->getShapeCollection()->offsetGet(1)->getPlotArea()->getType(); + $barChartHorz = clone $objPHPPresentation->getSlide(1)->getShapeCollection()->offsetGet(1)->getPlotArea()->getType(); $barChartHorz->setBarDirection(Bar3D::DIRECTION_HORIZONTAL); // Create templated slide echo EOL.date('H:i:s') . ' Create templated slide'.EOL; - $currentSlide = createTemplatedSlide($objPHPPowerPoint); + $currentSlide = createTemplatedSlide($objPHPPresentation); // Create a shape (chart) echo date('H:i:s') . ' Create a shape (chart)'.EOL; $shape = $currentSlide->createChartShape(); - $shape->setName('PHPPowerPoint Monthly Downloads') + $shape->setName('PHPPresentation Monthly Downloads') ->setResizeProportional(false) ->setHeight(550) ->setWidth(700) @@ -139,7 +139,7 @@ function fnSlide_BarHorizontal(PhpPowerpoint $objPHPPowerPoint) { $shape->setShadow($oShadow); $shape->setFill($oFill); $shape->getBorder()->setLineStyle(Border::LINE_SINGLE); - $shape->getTitle()->setText('PHPPowerPoint Monthly Downloads'); + $shape->getTitle()->setText('PHPPresentation Monthly Downloads'); $shape->getTitle()->getFont()->setItalic(true); $shape->getTitle()->getAlignment()->setHorizontal(Alignment::HORIZONTAL_RIGHT); $shape->getPlotArea()->getAxisX()->setTitle('Month'); @@ -149,13 +149,13 @@ function fnSlide_BarHorizontal(PhpPowerpoint $objPHPPowerPoint) { $shape->getLegend()->getFont()->setItalic(true); } -function fnSlide_BarStacked(PhpPowerpoint $objPHPPowerPoint) { +function fnSlide_BarStacked(PhpPresentation $objPHPPresentation) { global $oFill; global $oShadow; // Create templated slide echo EOL . date( 'H:i:s' ) . ' Create templated slide' . EOL; - $currentSlide = createTemplatedSlide( $objPHPPowerPoint ); + $currentSlide = createTemplatedSlide( $objPHPPresentation ); // Generate sample data for first chart echo date( 'H:i:s' ) . ' Generate sample data for chart' . EOL; @@ -191,7 +191,7 @@ function fnSlide_BarStacked(PhpPowerpoint $objPHPPowerPoint) { // Create a shape (chart) echo date( 'H:i:s' ) . ' Create a shape (chart)' . EOL; $shape = $currentSlide->createChartShape(); - $shape->setName( 'PHPPowerPoint Monthly Downloads' ) + $shape->setName( 'PHPPresentation Monthly Downloads' ) ->setResizeProportional( false ) ->setHeight( 550 ) ->setWidth( 700 ) @@ -200,7 +200,7 @@ function fnSlide_BarStacked(PhpPowerpoint $objPHPPowerPoint) { $shape->setShadow( $oShadow ); $shape->setFill( $oFill ); $shape->getBorder()->setLineStyle( Border::LINE_SINGLE ); - $shape->getTitle()->setText( 'PHPPowerPoint Monthly Downloads' ); + $shape->getTitle()->setText( 'PHPPresentation Monthly Downloads' ); $shape->getTitle()->getFont()->setItalic( true ); $shape->getTitle()->getAlignment()->setHorizontal( Alignment::HORIZONTAL_RIGHT ); $shape->getPlotArea()->getAxisX()->setTitle( 'Month' ); @@ -209,13 +209,13 @@ function fnSlide_BarStacked(PhpPowerpoint $objPHPPowerPoint) { $shape->getLegend()->getBorder()->setLineStyle( Border::LINE_SINGLE ); $shape->getLegend()->getFont()->setItalic( true ); } -function fnSlide_BarPercentStacked(PhpPowerpoint $objPHPPowerPoint) { +function fnSlide_BarPercentStacked(PhpPresentation $objPHPPresentation) { global $oFill; global $oShadow; // Create templated slide echo EOL . date( 'H:i:s' ) . ' Create templated slide' . EOL; - $currentSlide = createTemplatedSlide( $objPHPPowerPoint ); + $currentSlide = createTemplatedSlide( $objPHPPresentation ); // Generate sample data for first chart echo date( 'H:i:s' ) . ' Generate sample data for chart' . EOL; @@ -268,7 +268,7 @@ function fnSlide_BarPercentStacked(PhpPowerpoint $objPHPPowerPoint) { // Create a shape (chart) echo date( 'H:i:s' ) . ' Create a shape (chart)' . EOL; $shape = $currentSlide->createChartShape(); - $shape->setName( 'PHPPowerPoint Monthly Downloads' ) + $shape->setName( 'PHPPresentation Monthly Downloads' ) ->setResizeProportional( false ) ->setHeight( 550 ) ->setWidth( 700 ) @@ -277,7 +277,7 @@ function fnSlide_BarPercentStacked(PhpPowerpoint $objPHPPowerPoint) { $shape->setShadow( $oShadow ); $shape->setFill( $oFill ); $shape->getBorder()->setLineStyle( Border::LINE_SINGLE ); - $shape->getTitle()->setText( 'PHPPowerPoint Monthly Downloads' ); + $shape->getTitle()->setText( 'PHPPresentation Monthly Downloads' ); $shape->getTitle()->getFont()->setItalic( true ); $shape->getTitle()->getAlignment()->setHorizontal( Alignment::HORIZONTAL_RIGHT ); $shape->getPlotArea()->getAxisX()->setTitle( 'Month' ); @@ -287,13 +287,13 @@ function fnSlide_BarPercentStacked(PhpPowerpoint $objPHPPowerPoint) { $shape->getLegend()->getFont()->setItalic( true ); } -function fnSlide_Bar3D(PhpPowerpoint $objPHPPowerPoint) { +function fnSlide_Bar3D(PhpPresentation $objPHPPresentation) { global $oFill; global $oShadow; // Create templated slide echo EOL.date('H:i:s') . ' Create templated slide'.EOL; - $currentSlide = createTemplatedSlide($objPHPPowerPoint); + $currentSlide = createTemplatedSlide($objPHPPresentation); // Generate sample data for first chart echo date('H:i:s') . ' Generate sample data for chart'.EOL; @@ -318,7 +318,7 @@ function fnSlide_Bar3D(PhpPowerpoint $objPHPPowerPoint) { // Create a shape (chart) echo date('H:i:s') . ' Create a shape (chart)'.EOL; $shape = $currentSlide->createChartShape(); - $shape->setName('PHPPowerPoint Monthly Downloads') + $shape->setName('PHPPresentation Monthly Downloads') ->setResizeProportional(false) ->setHeight(550) ->setWidth(700) @@ -327,7 +327,7 @@ function fnSlide_Bar3D(PhpPowerpoint $objPHPPowerPoint) { $shape->setShadow($oShadow); $shape->setFill($oFill); $shape->getBorder()->setLineStyle(Border::LINE_SINGLE); - $shape->getTitle()->setText('PHPPowerPoint Monthly Downloads'); + $shape->getTitle()->setText('PHPPresentation Monthly Downloads'); $shape->getTitle()->getFont()->setItalic(true); $shape->getTitle()->getAlignment()->setHorizontal(Alignment::HORIZONTAL_RIGHT); $shape->getPlotArea()->getAxisX()->setTitle('Month'); @@ -340,23 +340,23 @@ function fnSlide_Bar3D(PhpPowerpoint $objPHPPowerPoint) { $shape->getLegend()->getFont()->setItalic(true); } -function fnSlide_Bar3DHorizontal(PhpPowerpoint $objPHPPowerPoint) { +function fnSlide_Bar3DHorizontal(PhpPresentation $objPHPPresentation) { global $oFill; global $oShadow; // Create a bar chart (that should be inserted in a shape) echo date('H:i:s') . ' Create a horizontal bar chart (that should be inserted in a chart shape) '.EOL; - $bar3DChartHorz = clone $objPHPPowerPoint->getSlide(5)->getShapeCollection()->offsetGet(1)->getPlotArea()->getType(); + $bar3DChartHorz = clone $objPHPPresentation->getSlide(5)->getShapeCollection()->offsetGet(1)->getPlotArea()->getType(); $bar3DChartHorz->setBarDirection(Bar3D::DIRECTION_HORIZONTAL); // Create templated slide echo EOL.date('H:i:s') . ' Create templated slide'.EOL; - $currentSlide = createTemplatedSlide($objPHPPowerPoint); + $currentSlide = createTemplatedSlide($objPHPPresentation); // Create a shape (chart) echo date('H:i:s') . ' Create a shape (chart)'.EOL; $shape = $currentSlide->createChartShape(); - $shape->setName('PHPPowerPoint Monthly Downloads') + $shape->setName('PHPPresentation Monthly Downloads') ->setResizeProportional(false) ->setHeight(550) ->setWidth(700) @@ -365,7 +365,7 @@ function fnSlide_Bar3DHorizontal(PhpPowerpoint $objPHPPowerPoint) { $shape->setShadow($oShadow); $shape->setFill($oFill); $shape->getBorder()->setLineStyle(Border::LINE_SINGLE); - $shape->getTitle()->setText('PHPPowerPoint Monthly Downloads'); + $shape->getTitle()->setText('PHPPresentation Monthly Downloads'); $shape->getTitle()->getFont()->setItalic(true); $shape->getTitle()->getAlignment()->setHorizontal(Alignment::HORIZONTAL_RIGHT); $shape->getPlotArea()->getAxisX()->setTitle('Month'); @@ -378,13 +378,13 @@ function fnSlide_Bar3DHorizontal(PhpPowerpoint $objPHPPowerPoint) { $shape->getLegend()->getFont()->setItalic(true); } -function fnSlide_Pie3D(PhpPowerpoint $objPHPPowerPoint) { +function fnSlide_Pie3D(PhpPresentation $objPHPPresentation) { global $oFill; global $oShadow; // Create templated slide echo EOL.date('H:i:s') . ' Create templated slide'.EOL; - $currentSlide = createTemplatedSlide($objPHPPowerPoint); + $currentSlide = createTemplatedSlide($objPHPPresentation); // Generate sample data for second chart echo date('H:i:s') . ' Generate sample data for chart'.EOL; @@ -408,7 +408,7 @@ function fnSlide_Pie3D(PhpPowerpoint $objPHPPowerPoint) { // Create a shape (chart) echo date('H:i:s') . ' Create a shape (chart)'.EOL; $shape = $currentSlide->createChartShape(); - $shape->setName('PHPPowerPoint Daily Downloads') + $shape->setName('PHPPresentation Daily Downloads') ->setResizeProportional(false) ->setHeight(550) ->setWidth(700) @@ -417,7 +417,7 @@ function fnSlide_Pie3D(PhpPowerpoint $objPHPPowerPoint) { $shape->setShadow($oShadow); $shape->setFill($oFill); $shape->getBorder()->setLineStyle(Border::LINE_SINGLE); - $shape->getTitle()->setText('PHPPowerPoint Daily Downloads'); + $shape->getTitle()->setText('PHPPresentation Daily Downloads'); $shape->getTitle()->getFont()->setItalic(true); $shape->getPlotArea()->setType($pie3DChart); $shape->getView3D()->setRotationX(30); @@ -426,13 +426,13 @@ function fnSlide_Pie3D(PhpPowerpoint $objPHPPowerPoint) { $shape->getLegend()->getFont()->setItalic(true); } -function fnSlide_Pie(PhpPowerpoint $objPHPPowerPoint) { +function fnSlide_Pie(PhpPresentation $objPHPPresentation) { global $oFill; global $oShadow; // Create templated slide echo EOL.date('H:i:s') . ' Create templated slide'.EOL; - $currentSlide = createTemplatedSlide($objPHPPowerPoint); + $currentSlide = createTemplatedSlide($objPHPPresentation); // Generate sample data for second chart echo date('H:i:s') . ' Generate sample data for chart'.EOL; @@ -459,7 +459,7 @@ function fnSlide_Pie(PhpPowerpoint $objPHPPowerPoint) { // Create a shape (chart) echo date('H:i:s') . ' Create a shape (chart)'.EOL; $shape = $currentSlide->createChartShape(); - $shape->setName('PHPPowerPoint Daily Downloads') + $shape->setName('PHPPresentation Daily Downloads') ->setResizeProportional(false) ->setHeight(550) ->setWidth(700) @@ -468,20 +468,20 @@ function fnSlide_Pie(PhpPowerpoint $objPHPPowerPoint) { $shape->setShadow($oShadow); $shape->setFill($oFill); $shape->getBorder()->setLineStyle(Border::LINE_SINGLE); - $shape->getTitle()->setText('PHPPowerPoint Daily Downloads'); + $shape->getTitle()->setText('PHPPresentation Daily Downloads'); $shape->getTitle()->getFont()->setItalic(true); $shape->getPlotArea()->setType($pieChart); $shape->getLegend()->getBorder()->setLineStyle(Border::LINE_SINGLE); $shape->getLegend()->getFont()->setItalic(true); } -function fnSlide_Scatter(PhpPowerpoint $objPHPPowerPoint) { +function fnSlide_Scatter(PhpPresentation $objPHPPresentation) { global $oFill; global $oShadow; // Create templated slide echo EOL.date('H:i:s') . ' Create templated slide'.EOL; - $currentSlide = createTemplatedSlide($objPHPPowerPoint); // local function + $currentSlide = createTemplatedSlide($objPHPPresentation); // local function // Generate sample data for fourth chart echo date('H:i:s') . ' Generate sample data for chart'.EOL; @@ -497,7 +497,7 @@ function fnSlide_Scatter(PhpPowerpoint $objPHPPowerPoint) { // Create a shape (chart) echo date('H:i:s') . ' Create a shape (chart)'.EOL; $shape = $currentSlide->createChartShape(); - $shape->setName('PHPPowerPoint Daily Download Distribution') + $shape->setName('PHPPresentation Daily Download Distribution') ->setResizeProportional(false) ->setHeight(550) ->setWidth(700) @@ -506,7 +506,7 @@ function fnSlide_Scatter(PhpPowerpoint $objPHPPowerPoint) { $shape->setShadow($oShadow); $shape->setFill($oFill); $shape->getBorder()->setLineStyle(Border::LINE_SINGLE); - $shape->getTitle()->setText('PHPPowerPoint Daily Downloads'); + $shape->getTitle()->setText('PHPPresentation Daily Downloads'); $shape->getTitle()->getFont()->setItalic(true); $shape->getPlotArea()->setType($lineChart); $shape->getView3D()->setRotationX(30); @@ -515,14 +515,14 @@ function fnSlide_Scatter(PhpPowerpoint $objPHPPowerPoint) { $shape->getLegend()->getFont()->setItalic(true); } -// Create new PHPPowerPoint object -echo date('H:i:s') . ' Create new PHPPowerPoint object'.EOL; -$objPHPPowerPoint = new PhpPowerpoint(); +// Create new PHPPresentation object +echo date('H:i:s') . ' Create new PHPPresentation object'.EOL; +$objPHPPresentation = new PhpPresentation(); // Set properties echo date('H:i:s') . ' Set properties'.EOL; -$objPHPPowerPoint->getProperties()->setCreator('PHPOffice') - ->setLastModifiedBy('PHPPowerPoint Team') +$objPHPPresentation->getProperties()->setCreator('PHPOffice') + ->setLastModifiedBy('PHPPresentation Team') ->setTitle('Sample 07 Title') ->setSubject('Sample 07 Subject') ->setDescription('Sample 07 Description') @@ -531,7 +531,7 @@ function fnSlide_Scatter(PhpPowerpoint $objPHPPowerPoint) { // Remove first slide echo date('H:i:s') . ' Remove first slide'.EOL; -$objPHPPowerPoint->removeSlideByIndex(0); +$objPHPPresentation->removeSlideByIndex(0); // Set Style $oFill = new Fill(); @@ -540,28 +540,28 @@ function fnSlide_Scatter(PhpPowerpoint $objPHPPowerPoint) { $oShadow = new Shadow(); $oShadow->setVisible(true)->setDirection(45)->setDistance(10); -fnSlide_Area($objPHPPowerPoint); +fnSlide_Area($objPHPPresentation); -fnSlide_Bar($objPHPPowerPoint); +fnSlide_Bar($objPHPPresentation); -fnSlide_BarStacked($objPHPPowerPoint); +fnSlide_BarStacked($objPHPPresentation); -fnSlide_BarPercentStacked($objPHPPowerPoint); +fnSlide_BarPercentStacked($objPHPPresentation); -fnSlide_BarHorizontal($objPHPPowerPoint); +fnSlide_BarHorizontal($objPHPPresentation); -fnSlide_Bar3D($objPHPPowerPoint); +fnSlide_Bar3D($objPHPPresentation); -fnSlide_Bar3DHorizontal($objPHPPowerPoint); +fnSlide_Bar3DHorizontal($objPHPPresentation); -fnSlide_Pie3D($objPHPPowerPoint); +fnSlide_Pie3D($objPHPPresentation); -fnSlide_Pie($objPHPPowerPoint); +fnSlide_Pie($objPHPPresentation); -fnSlide_Scatter($objPHPPowerPoint); +fnSlide_Scatter($objPHPPresentation); // Save file -echo write($objPHPPowerPoint, basename(__FILE__, '.php'), $writers); +echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers); if (!CLI) { include_once 'Sample_Footer.php'; } diff --git a/samples/Sample_05_Chart_Line.php b/samples/Sample_05_Chart_Line.php index 66eae16ae..e249d69c2 100644 --- a/samples/Sample_05_Chart_Line.php +++ b/samples/Sample_05_Chart_Line.php @@ -2,29 +2,29 @@ include_once 'Sample_Header.php'; -use PhpOffice\PhpPowerpoint\PhpPowerpoint; -use PhpOffice\PhpPowerpoint\Shape\Chart\Type\Bar3D; -use PhpOffice\PhpPowerpoint\Shape\Chart\Type\Line; -use PhpOffice\PhpPowerpoint\Shape\Chart\Type\Pie3D; -use PhpOffice\PhpPowerpoint\Shape\Chart\Type\Scatter; -use PhpOffice\PhpPowerpoint\Shape\Chart\Series; -use PhpOffice\PhpPowerpoint\Style\Alignment; -use PhpOffice\PhpPowerpoint\Style\Border; -use PhpOffice\PhpPowerpoint\Style\Color; -use PhpOffice\PhpPowerpoint\Style\Fill; -use PhpOffice\PhpPowerpoint\Style\Shadow; - -// Create new PHPPowerPoint object -echo date('H:i:s') . ' Create new PHPPowerPoint object' . EOL; -$objPHPPowerPoint = new PhpPowerpoint(); +use PhpOffice\PhpPresentation\PhpPresentation; +use PhpOffice\PhpPresentation\Shape\Chart\Type\Bar3D; +use PhpOffice\PhpPresentation\Shape\Chart\Type\Line; +use PhpOffice\PhpPresentation\Shape\Chart\Type\Pie3D; +use PhpOffice\PhpPresentation\Shape\Chart\Type\Scatter; +use PhpOffice\PhpPresentation\Shape\Chart\Series; +use PhpOffice\PhpPresentation\Style\Alignment; +use PhpOffice\PhpPresentation\Style\Border; +use PhpOffice\PhpPresentation\Style\Color; +use PhpOffice\PhpPresentation\Style\Fill; +use PhpOffice\PhpPresentation\Style\Shadow; + +// Create new PHPPresentation object +echo date('H:i:s') . ' Create new PHPPresentation object' . EOL; +$objPHPPresentation = new PhpPresentation(); // Set properties echo date('H:i:s') . ' Set properties' . EOL; -$objPHPPowerPoint->getProperties()->setCreator('PHPOffice')->setLastModifiedBy('PHPPowerPoint Team')->setTitle('Sample 07 Title')->setSubject('Sample 07 Subject')->setDescription('Sample 07 Description')->setKeywords('office 2007 openxml libreoffice odt php')->setCategory('Sample Category'); +$objPHPPresentation->getProperties()->setCreator('PHPOffice')->setLastModifiedBy('PHPPresentation Team')->setTitle('Sample 07 Title')->setSubject('Sample 07 Subject')->setDescription('Sample 07 Description')->setKeywords('office 2007 openxml libreoffice odt php')->setCategory('Sample Category'); // Remove first slide echo date('H:i:s') . ' Remove first slide' . EOL; -$objPHPPowerPoint->removeSlideByIndex(0); +$objPHPPresentation->removeSlideByIndex(0); // Set Style $oFill = new Fill(); @@ -47,7 +47,7 @@ // Create templated slide echo EOL . date('H:i:s') . ' Create templated slide' . EOL; -$currentSlide = createTemplatedSlide($objPHPPowerPoint); +$currentSlide = createTemplatedSlide($objPHPPresentation); // Create a line chart (that should be inserted in a shape) echo date('H:i:s') . ' Create a line chart (that should be inserted in a chart shape)' . EOL; @@ -60,11 +60,11 @@ // Create a shape (chart) echo date('H:i:s') . ' Create a shape (chart)' . EOL; $shape = $currentSlide->createChartShape(); -$shape->setName('PHPPowerPoint Daily Downloads')->setResizeProportional(false)->setHeight(550)->setWidth(700)->setOffsetX(120)->setOffsetY(80); +$shape->setName('PHPPresentation Daily Downloads')->setResizeProportional(false)->setHeight(550)->setWidth(700)->setOffsetX(120)->setOffsetY(80); $shape->setShadow($oShadow); $shape->setFill($oFill); $shape->getBorder()->setLineStyle(Border::LINE_SINGLE); -$shape->getTitle()->setText('PHPPowerPoint Daily Downloads'); +$shape->getTitle()->setText('PHPPresentation Daily Downloads'); $shape->getTitle()->getFont()->setItalic(true); $shape->getPlotArea()->setType($lineChart); $shape->getView3D()->setRotationX(30); @@ -74,7 +74,7 @@ // Create templated slide echo EOL . date('H:i:s') . ' Create templated slide' . EOL; -$currentSlide = createTemplatedSlide($objPHPPowerPoint); +$currentSlide = createTemplatedSlide($objPHPPresentation); // Create a line chart (that should be inserted in a shape) echo date('H:i:s') . ' Create a line chart (that should be inserted in a chart shape)' . EOL; @@ -85,15 +85,15 @@ echo date('H:i:s') . ' Differences with previous : Values on right axis and Legend hidden' . EOL; $shape1 = clone $shape; $shape1->getLegend()->setVisible(false); -$shape1->setName('PHPPowerPoint Weekly Downloads'); -$shape1->getTitle()->setText('PHPPowerPoint Weekly Downloads'); +$shape1->setName('PHPPresentation Weekly Downloads'); +$shape1->getTitle()->setText('PHPPresentation Weekly Downloads'); $shape1->getPlotArea()->setType($lineChart1); $shape1->getPlotArea()->getAxisY()->setFormatCode('#,##0'); $currentSlide->addShape($shape1); // Create templated slide echo EOL . date('H:i:s') . ' Create templated slide' . EOL; -$currentSlide = createTemplatedSlide($objPHPPowerPoint); +$currentSlide = createTemplatedSlide($objPHPPresentation); // Create a line chart (that should be inserted in a shape) echo date('H:i:s') . ' Create a line chart (that should be inserted in a chart shape)' . EOL; @@ -107,14 +107,14 @@ echo date('H:i:s') . ' Differences with previous : Values on right axis and Legend hidden' . EOL; $shape2 = clone $shape; $shape2->getLegend()->setVisible(false); -$shape2->setName('PHPPowerPoint Weekly Downloads'); -$shape2->getTitle()->setText('PHPPowerPoint Weekly Downloads'); +$shape2->setName('PHPPresentation Weekly Downloads'); +$shape2->getTitle()->setText('PHPPresentation Weekly Downloads'); $shape2->getPlotArea()->setType($lineChart2); $shape2->getPlotArea()->getAxisY()->setFormatCode('#,##0'); $currentSlide->addShape($shape2); // Save file -echo EOL . write($objPHPPowerPoint, basename(__FILE__, '.php'), $writers); +echo EOL . write($objPHPPresentation, basename(__FILE__, '.php'), $writers); if (!CLI) { include_once 'Sample_Footer.php'; diff --git a/samples/Sample_05_Chart_with_PHPExcel.php b/samples/Sample_05_Chart_with_PHPExcel.php index bb56ab5ba..0968fa26a 100644 --- a/samples/Sample_05_Chart_with_PHPExcel.php +++ b/samples/Sample_05_Chart_with_PHPExcel.php @@ -2,25 +2,25 @@ include_once 'Sample_Header.php'; -use PhpOffice\PhpPowerpoint\PhpPowerpoint; -use PhpOffice\PhpPowerpoint\Shape\Chart\Type\Bar3D; -use PhpOffice\PhpPowerpoint\Shape\Chart\Type\Pie3D; -use PhpOffice\PhpPowerpoint\Shape\Chart\Series; -use PhpOffice\PhpPowerpoint\Style\Fill; -use PhpOffice\PhpPowerpoint\Style\Color; -use PhpOffice\PhpPowerpoint\Style\Border; +use PhpOffice\PhpPresentation\PhpPresentation; +use PhpOffice\PhpPresentation\Shape\Chart\Type\Bar3D; +use PhpOffice\PhpPresentation\Shape\Chart\Type\Pie3D; +use PhpOffice\PhpPresentation\Shape\Chart\Series; +use PhpOffice\PhpPresentation\Style\Fill; +use PhpOffice\PhpPresentation\Style\Color; +use PhpOffice\PhpPresentation\Style\Border; if (!class_exists('PHPExcel')) { echo('PHPExcel has not been loaded. Include PHPExcel.php in your script, e.g. require_once \'PHPExcel.php\'.'); } else { - // Create new PHPPowerPoint object - echo date('H:i:s') . ' Create new PHPPowerPoint object'.EOL; - $objPHPPowerPoint = new PhpPowerpoint(); + // Create new PHPPresentation object + echo date('H:i:s') . ' Create new PHPPresentation object'.EOL; + $objPHPPresentation = new PhpPresentation(); // Set properties echo date('H:i:s') . ' Set properties'.EOL; - $objPHPPowerPoint->getProperties()->setCreator('PHPOffice') - ->setLastModifiedBy('PHPPowerPoint Team') + $objPHPPresentation->getProperties()->setCreator('PHPOffice') + ->setLastModifiedBy('PHPPresentation Team') ->setTitle('Sample 08 Title') ->setSubject('Sample 08 Subject') ->setDescription('Sample 08 Description') @@ -29,11 +29,11 @@ // Remove first slide echo date('H:i:s') . ' Remove first slide'.EOL; - $objPHPPowerPoint->removeSlideByIndex(0); + $objPHPPresentation->removeSlideByIndex(0); // Create templated slide echo date('H:i:s') . ' Create templated slide'.EOL; - $currentSlide = createTemplatedSlide($objPHPPowerPoint); // local function + $currentSlide = createTemplatedSlide($objPHPPresentation); // local function // Generate sample data for first chart echo date('H:i:s') . ' Generate sample data for first chart'.EOL; @@ -49,7 +49,7 @@ // Create a shape (chart) echo date('H:i:s') . ' Create a shape (chart)'.EOL; $shape = $currentSlide->createChartShape(); - $shape->setName('PHPPowerPoint Monthly Downloads') + $shape->setName('PHPPresentation Monthly Downloads') ->setResizeProportional(false) ->setHeight(550) ->setWidth(700) @@ -64,7 +64,7 @@ ->setEndColor(new Color('FFFFFFFF')) ->setRotation(270); $shape->getBorder()->setLineStyle(Border::LINE_SINGLE); - $shape->getTitle()->setText('PHPPowerPoint Monthly Downloads'); + $shape->getTitle()->setText('PHPPresentation Monthly Downloads'); $shape->getTitle()->getFont()->setItalic(true); $shape->getPlotArea()->getAxisX()->setTitle('Month'); $shape->getPlotArea()->getAxisY()->setTitle('Downloads'); @@ -77,7 +77,7 @@ // Create templated slide echo date('H:i:s') . ' Create templated slide'.EOL; - $currentSlide = createTemplatedSlide($objPHPPowerPoint); // local function + $currentSlide = createTemplatedSlide($objPHPPresentation); // local function // Generate sample data for second chart echo date('H:i:s') . ' Generate sample data for second chart'.EOL; @@ -91,7 +91,7 @@ // Create a shape (chart) echo date('H:i:s') . ' Create a shape (chart)'.EOL; $shape = $currentSlide->createChartShape(); - $shape->setName('PHPPowerPoint Daily Downloads') + $shape->setName('PHPPresentation Daily Downloads') ->setResizeProportional(false) ->setHeight(550) ->setWidth(700) @@ -106,7 +106,7 @@ ->setEndColor(new Color('FFFFFFFF')) ->setRotation(270); $shape->getBorder()->setLineStyle(Border::LINE_SINGLE); - $shape->getTitle()->setText('PHPPowerPoint Daily Downloads'); + $shape->getTitle()->setText('PHPPresentation Daily Downloads'); $shape->getTitle()->getFont()->setItalic(true); $shape->getPlotArea()->setType($pie3DChart); $shape->getView3D()->setRotationX(30); @@ -115,7 +115,7 @@ $shape->getLegend()->getFont()->setItalic(true); // Save file - echo write($objPHPPowerPoint, basename(__FILE__, '.php'), $writers); + echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers); } if (!CLI) { include_once 'Sample_Footer.php'; diff --git a/samples/Sample_06_Fill.php b/samples/Sample_06_Fill.php index f4322e209..906c6916c 100644 --- a/samples/Sample_06_Fill.php +++ b/samples/Sample_06_Fill.php @@ -2,19 +2,19 @@ include_once 'Sample_Header.php'; -use PhpOffice\PhpPowerpoint\PhpPowerpoint; -use PhpOffice\PhpPowerpoint\Style\Alignment; -use PhpOffice\PhpPowerpoint\Style\Color; -use PhpOffice\PhpPowerpoint\Style\Fill; +use PhpOffice\PhpPresentation\PhpPresentation; +use PhpOffice\PhpPresentation\Style\Alignment; +use PhpOffice\PhpPresentation\Style\Color; +use PhpOffice\PhpPresentation\Style\Fill; -// Create new PHPPowerPoint object -echo date('H:i:s') . ' Create new PHPPowerPoint object' . EOL; -$objPHPPowerPoint = new PhpPowerpoint(); +// Create new PHPPresentation object +echo date('H:i:s') . ' Create new PHPPresentation object' . EOL; +$objPHPPresentation = new PhpPresentation(); // Set properties echo date('H:i:s') . ' Set properties'.EOL; -$objPHPPowerPoint->getProperties()->setCreator('PHPOffice') - ->setLastModifiedBy('PHPPowerPoint Team') +$objPHPPresentation->getProperties()->setCreator('PHPOffice') + ->setLastModifiedBy('PHPPresentation Team') ->setTitle('Sample 01 Title') ->setSubject('Sample 01 Subject') ->setDescription('Sample 01 Description') @@ -23,7 +23,7 @@ // Create slide echo date('H:i:s') . ' Create slide'.EOL; -$currentSlide = $objPHPPowerPoint->getActiveSlide(); +$currentSlide = $objPHPPresentation->getActiveSlide(); for($inc = 1 ; $inc <= 4 ; $inc++){ @@ -59,14 +59,14 @@ break; } - $textRun = $shape->createTextRun('Use PHPPowerPoint!'); + $textRun = $shape->createTextRun('Use PHPPresentation!'); $textRun->getFont()->setBold(true) ->setSize(30) ->setColor( new Color('FFE06B20') ); } // Save file -echo write($objPHPPowerPoint, basename(__FILE__, '.php'), $writers); +echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers); if (!CLI) { include_once 'Sample_Footer.php'; } diff --git a/samples/Sample_07_Border.php b/samples/Sample_07_Border.php index e1648a8f4..a6ec67803 100644 --- a/samples/Sample_07_Border.php +++ b/samples/Sample_07_Border.php @@ -2,23 +2,23 @@ include_once 'Sample_Header.php'; -use PhpOffice\PhpPowerpoint\PhpPowerpoint; -use PhpOffice\PhpPowerpoint\Style\Alignment; -use PhpOffice\PhpPowerpoint\Style\Color; -use PhpOffice\PhpPowerpoint\Style\Fill; -use PhpOffice\PhpPowerpoint\Style\Border; +use PhpOffice\PhpPresentation\PhpPresentation; +use PhpOffice\PhpPresentation\Style\Alignment; +use PhpOffice\PhpPresentation\Style\Color; +use PhpOffice\PhpPresentation\Style\Fill; +use PhpOffice\PhpPresentation\Style\Border; -// Create new PHPPowerPoint object -echo date('H:i:s') . ' Create new PHPPowerPoint object' . EOL; -$objPHPPowerPoint = new PhpPowerpoint(); +// Create new PHPPresentation object +echo date('H:i:s') . ' Create new PHPPresentation object' . EOL; +$objPHPPresentation = new PhpPresentation(); // Set properties echo date('H:i:s') . ' Set properties' . EOL; -$objPHPPowerPoint->getProperties()->setCreator('PHPOffice')->setLastModifiedBy('PHPPowerPoint Team')->setTitle('Sample 01 Title')->setSubject('Sample 01 Subject')->setDescription('Sample 01 Description')->setKeywords('office 2007 openxml libreoffice odt php')->setCategory('Sample Category'); +$objPHPPresentation->getProperties()->setCreator('PHPOffice')->setLastModifiedBy('PHPPresentation Team')->setTitle('Sample 01 Title')->setSubject('Sample 01 Subject')->setDescription('Sample 01 Description')->setKeywords('office 2007 openxml libreoffice odt php')->setCategory('Sample Category'); // Create slide echo date('H:i:s') . ' Create slide' . EOL; -$currentSlide = $objPHPPowerPoint->getActiveSlide(); +$currentSlide = $objPHPPresentation->getActiveSlide(); for ($inc = 1; $inc <= 4; $inc++) { @@ -52,12 +52,12 @@ break; } - $textRun = $shape->createTextRun('Use PHPPowerPoint!'); + $textRun = $shape->createTextRun('Use PHPPresentation!'); $textRun->getFont()->setBold(true)->setSize(30)->setColor(new Color('FFE06B20')); } // Save file -echo write($objPHPPowerPoint, basename(__FILE__, '.php'), $writers); +echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers); if (!CLI) { include_once 'Sample_Footer.php'; } diff --git a/samples/Sample_08_Group.php b/samples/Sample_08_Group.php index fd75ed7b0..3f4e6e80d 100644 --- a/samples/Sample_08_Group.php +++ b/samples/Sample_08_Group.php @@ -2,18 +2,18 @@ include_once 'Sample_Header.php'; -use PhpOffice\PhpPowerpoint\PhpPowerpoint; -use PhpOffice\PhpPowerpoint\Style\Alignment; -use PhpOffice\PhpPowerpoint\Style\Color; +use PhpOffice\PhpPresentation\PhpPresentation; +use PhpOffice\PhpPresentation\Style\Alignment; +use PhpOffice\PhpPresentation\Style\Color; -// Create new PHPPowerPoint object -echo date('H:i:s') . ' Create new PHPPowerPoint object' . EOL; -$objPHPPowerPoint = new PhpPowerpoint(); +// Create new PHPPresentation object +echo date('H:i:s') . ' Create new PHPPresentation object' . EOL; +$objPHPPresentation = new PhpPresentation(); // Set properties echo date('H:i:s') . ' Set properties'.EOL; -$objPHPPowerPoint->getProperties()->setCreator('PHPOffice') - ->setLastModifiedBy('PHPPowerPoint Team') +$objPHPPresentation->getProperties()->setCreator('PHPOffice') + ->setLastModifiedBy('PHPPresentation Team') ->setTitle('Sample 01 Title') ->setSubject('Sample 01 Subject') ->setDescription('Sample 01 Description') @@ -22,13 +22,13 @@ // Create slide echo date('H:i:s') . ' Create slide'.EOL; -$currentGroup = $objPHPPowerPoint->getActiveSlide()->createGroup(); +$currentGroup = $objPHPPresentation->getActiveSlide()->createGroup(); // Create a shape (drawing) echo date('H:i:s') . ' Create a shape (drawing)'.EOL; $shape = $currentGroup->createDrawingShape(); -$shape->setName('PHPPowerPoint logo') - ->setDescription('PHPPowerPoint logo') +$shape->setName('PHPPresentation logo') + ->setDescription('PHPPresentation logo') ->setPath('./resources/phppowerpoint_logo.gif') ->setHeight(36) ->setOffsetX(10) @@ -45,13 +45,13 @@ ->setOffsetX(170) ->setOffsetY(180); $shape->getActiveParagraph()->getAlignment()->setHorizontal( Alignment::HORIZONTAL_CENTER ); -$textRun = $shape->createTextRun('Thank you for using PHPPowerPoint!'); +$textRun = $shape->createTextRun('Thank you for using PHPPresentation!'); $textRun->getFont()->setBold(true) ->setSize(60) ->setColor( new Color( 'FFE06B20' ) ); // Save file -echo write($objPHPPowerPoint, basename(__FILE__, '.php'), $writers); +echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers); if (!CLI) { include_once 'Sample_Footer.php'; } diff --git a/samples/Sample_09_SlideNote.php b/samples/Sample_09_SlideNote.php index 152d92d6a..b17537f43 100644 --- a/samples/Sample_09_SlideNote.php +++ b/samples/Sample_09_SlideNote.php @@ -2,29 +2,29 @@ include_once 'Sample_Header.php'; -use PhpOffice\PhpPowerpoint\PhpPowerpoint; -use PhpOffice\PhpPowerpoint\Style\Alignment; -use PhpOffice\PhpPowerpoint\Style\Color; -use PhpOffice\PhpPowerpoint\Style\Fill; -use PhpOffice\PhpPowerpoint\Style\Border; +use PhpOffice\PhpPresentation\PhpPresentation; +use PhpOffice\PhpPresentation\Style\Alignment; +use PhpOffice\PhpPresentation\Style\Color; +use PhpOffice\PhpPresentation\Style\Fill; +use PhpOffice\PhpPresentation\Style\Border; -// Create new PHPPowerPoint object -echo date('H:i:s') . ' Create new PHPPowerPoint object' . EOL; -$objPHPPowerPoint = new PhpPowerpoint(); +// Create new PHPPresentation object +echo date('H:i:s') . ' Create new PHPPresentation object' . EOL; +$objPHPPresentation = new PhpPresentation(); // Set properties echo date('H:i:s') . ' Set properties' . EOL; -$objPHPPowerPoint->getProperties()->setCreator('PHPOffice')->setLastModifiedBy('PHPPowerPoint Team')->setTitle('Sample 01 Title')->setSubject('Sample 01 Subject')->setDescription('Sample 01 Description')->setKeywords('office 2007 openxml libreoffice odt php')->setCategory('Sample Category'); +$objPHPPresentation->getProperties()->setCreator('PHPOffice')->setLastModifiedBy('PHPPresentation Team')->setTitle('Sample 01 Title')->setSubject('Sample 01 Subject')->setDescription('Sample 01 Description')->setKeywords('office 2007 openxml libreoffice odt php')->setCategory('Sample Category'); // Create slide echo date('H:i:s') . ' Create slide' . EOL; -$currentSlide = $objPHPPowerPoint->getActiveSlide(); +$currentSlide = $objPHPPresentation->getActiveSlide(); // Create a shape (drawing) echo date('H:i:s') . ' Create a shape (drawing)'.EOL; $shape = $currentSlide->createDrawingShape(); -$shape->setName('PHPPowerPoint logo') -->setDescription('PHPPowerPoint logo') +$shape->setName('PHPPresentation logo') +->setDescription('PHPPresentation logo') ->setPath('./resources/phppowerpoint_logo.gif') ->setHeight(36) ->setOffsetX(10) @@ -32,7 +32,7 @@ $shape->getShadow()->setVisible(true) ->setDirection(45) ->setDistance(10); -$shape->getHyperlink()->setUrl('https://github.com/PHPOffice/PHPPowerPoint/')->setTooltip('PHPPowerPoint'); +$shape->getHyperlink()->setUrl('https://github.com/PHPOffice/PHPPresentation/')->setTooltip('PHPPresentation'); // Create a shape (text) echo date('H:i:s') . ' Create a shape (rich text)'.EOL; @@ -42,7 +42,7 @@ ->setOffsetX(170) ->setOffsetY(180); $shape->getActiveParagraph()->getAlignment()->setHorizontal( Alignment::HORIZONTAL_CENTER ); -$textRun = $shape->createTextRun('Thank you for using PHPPowerPoint!'); +$textRun = $shape->createTextRun('Thank you for using PHPPresentation!'); $textRun->getFont()->setBold(true) ->setSize(60) ->setColor( new Color( 'FFE06B20' ) ); @@ -57,7 +57,7 @@ $oRichText->createParagraph()->createTextRun('Supports writing to different file formats'); // Save file -echo write($objPHPPowerPoint, basename(__FILE__, '.php'), $writers); +echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers); if (!CLI) { include_once 'Sample_Footer.php'; } diff --git a/samples/Sample_10_Transition.php b/samples/Sample_10_Transition.php index ed1106ef5..b9791406b 100644 --- a/samples/Sample_10_Transition.php +++ b/samples/Sample_10_Transition.php @@ -2,19 +2,19 @@ include_once 'Sample_Header.php'; -use PhpOffice\PhpPowerpoint\PhpPowerpoint; -use PhpOffice\PhpPowerpoint\Style\Alignment; -use PhpOffice\PhpPowerpoint\Style\Color; -use PhpOffice\PhpPowerpoint\Slide\Transition; +use PhpOffice\PhpPresentation\PhpPresentation; +use PhpOffice\PhpPresentation\Style\Alignment; +use PhpOffice\PhpPresentation\Style\Color; +use PhpOffice\PhpPresentation\Slide\Transition; -// Create new PHPPowerPoint object -echo date('H:i:s') . ' Create new PHPPowerPoint object' . EOL; -$objPHPPowerPoint = new PhpPowerpoint(); +// Create new PHPPresentation object +echo date('H:i:s') . ' Create new PHPPresentation object' . EOL; +$objPHPPresentation = new PhpPresentation(); // Set properties echo date('H:i:s') . ' Set properties'.EOL; -$objPHPPowerPoint->getProperties()->setCreator('PHPOffice') - ->setLastModifiedBy('PHPPowerPoint Team') +$objPHPPresentation->getProperties()->setCreator('PHPOffice') + ->setLastModifiedBy('PHPPresentation Team') ->setTitle('Sample 10 Title') ->setSubject('Sample 10 Subject') ->setDescription('Sample 10 Description') @@ -23,13 +23,13 @@ // Create slide echo date('H:i:s') . ' Create slide'.EOL; -$slide0 = $objPHPPowerPoint->getActiveSlide(); +$slide0 = $objPHPPresentation->getActiveSlide(); // Create a shape (drawing) echo date('H:i:s') . ' Create a shape (drawing)'.EOL; $shapeDrawing = $slide0->createDrawingShape(); -$shapeDrawing->setName('PHPPowerPoint logo') - ->setDescription('PHPPowerPoint logo') +$shapeDrawing->setName('PHPPresentation logo') + ->setDescription('PHPPresentation logo') ->setPath('./resources/phppowerpoint_logo.gif') ->setHeight(36) ->setOffsetX(10) @@ -37,7 +37,7 @@ $shapeDrawing->getShadow()->setVisible(true) ->setDirection(45) ->setDistance(10); -$shapeDrawing->getHyperlink()->setUrl('https://github.com/PHPOffice/PHPPowerPoint/')->setTooltip('PHPPowerPoint'); +$shapeDrawing->getHyperlink()->setUrl('https://github.com/PHPOffice/PHPPresentation/')->setTooltip('PHPPresentation'); // Create a shape (text) echo date('H:i:s') . ' Create a shape (rich text)'.EOL; @@ -47,7 +47,7 @@ ->setOffsetX(170) ->setOffsetY(180); $shapeRichText->getActiveParagraph()->getAlignment()->setHorizontal( Alignment::HORIZONTAL_CENTER ); -$textRun = $shapeRichText->createTextRun('Thank you for using PHPPowerPoint!'); +$textRun = $shapeRichText->createTextRun('Thank you for using PHPPresentation!'); $textRun->getFont()->setBold(true) ->setSize(60) ->setColor( new Color( 'FFE06B20' ) ); @@ -60,12 +60,12 @@ // Create slide echo date('H:i:s') . ' Create slide'.EOL; -$slide1 = $objPHPPowerPoint->createSlide(); +$slide1 = $objPHPPresentation->createSlide(); $slide1->addShape(clone $shapeDrawing); $slide1->addShape(clone $shapeRichText); // Save file -echo write($objPHPPowerPoint, basename(__FILE__, '.php'), $writers); +echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers); if (!CLI) { include_once 'Sample_Footer.php'; } diff --git a/samples/Sample_11_Shape.php b/samples/Sample_11_Shape.php index 36a17791d..b6ab9f58c 100644 --- a/samples/Sample_11_Shape.php +++ b/samples/Sample_11_Shape.php @@ -1,16 +1,16 @@ getFont()->setColor(new Color( 'FF000000' )); } -function fnSlideRichTextShadow(PhpPowerpoint $objPHPPowerPoint) { +function fnSlideRichTextShadow(PhpPresentation $objPHPPresentation) { // Create templated slide echo date('H:i:s') . ' Create templated slide'.EOL; - $currentSlide = createTemplatedSlide($objPHPPowerPoint); + $currentSlide = createTemplatedSlide($objPHPPresentation); // Create a shape (text) echo date('H:i:s') . ' Create a shape (rich text) with shadow'.EOL; @@ -53,15 +53,15 @@ function fnSlideRichTextShadow(PhpPowerpoint $objPHPPowerPoint) { $textRun->getFont()->setColor(new Color( 'FF000000' )); } -// Create new PHPPowerPoint object -echo date('H:i:s') . ' Create new PHPPowerPoint object'.EOL; -$objPHPPowerPoint = new PhpPowerpoint(); +// Create new PHPPresentation object +echo date('H:i:s') . ' Create new PHPPresentation object'.EOL; +$objPHPPresentation = new PhpPresentation(); // Set properties echo date('H:i:s') . ' Set properties'.EOL; -$oProperties = $objPHPPowerPoint->getProperties(); +$oProperties = $objPHPPresentation->getProperties(); $oProperties->setCreator('PHPOffice') - ->setLastModifiedBy('PHPPowerPoint Team') + ->setLastModifiedBy('PHPPresentation Team') ->setTitle('Sample 11 Title') ->setSubject('Sample 11 Subject') ->setDescription('Sample 11 Description') @@ -70,13 +70,13 @@ function fnSlideRichTextShadow(PhpPowerpoint $objPHPPowerPoint) { // Remove first slide echo date('H:i:s') . ' Remove first slide'.EOL; -$objPHPPowerPoint->removeSlideByIndex(0); +$objPHPPresentation->removeSlideByIndex(0); -fnSlideRichText($objPHPPowerPoint); -fnSlideRichTextShadow($objPHPPowerPoint); +fnSlideRichText($objPHPPresentation); +fnSlideRichTextShadow($objPHPPresentation); // Save file -echo write($objPHPPowerPoint, basename(__FILE__, '.php'), $writers); +echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers); if (!CLI) { include_once 'Sample_Footer.php'; } diff --git a/samples/Sample_12_Reader_PowerPoint97.php b/samples/Sample_12_Reader_PowerPoint97.php index cec570d8f..f01576261 100644 --- a/samples/Sample_12_Reader_PowerPoint97.php +++ b/samples/Sample_12_Reader_PowerPoint97.php @@ -4,24 +4,24 @@ include_once 'Sample_Header.php'; -use PhpOffice\PhpPowerpoint\PhpPowerpoint; -use PhpOffice\PhpPowerpoint\DocumentLayout; -use PhpOffice\PhpPowerpoint\IOFactory; -use PhpOffice\PhpPowerpoint\Style\Alignment; -use PhpOffice\PhpPowerpoint\Style\Color; -use PhpOffice\PhpPowerpoint\Slide; -use PhpOffice\PhpPowerpoint\AbstractShape; -use PhpOffice\PhpPowerpoint\Shape\MemoryDrawing; -use PhpOffice\PhpPowerpoint\Shape\RichText; -use PhpOffice\PhpPowerPoint\Shape\Group; +use PhpOffice\PhpPresentation\PhpPresentation; +use PhpOffice\PhpPresentation\DocumentLayout; +use PhpOffice\PhpPresentation\IOFactory; +use PhpOffice\PhpPresentation\Style\Alignment; +use PhpOffice\PhpPresentation\Style\Color; +use PhpOffice\PhpPresentation\Slide; +use PhpOffice\PhpPresentation\AbstractShape; +use PhpOffice\PhpPresentation\Shape\MemoryDrawing; +use PhpOffice\PhpPresentation\Shape\RichText; +use PhpOffice\PhpPresentation\Shape\Group; class PhpPptTree { - protected $oPhpPowerpoint; + protected $oPhpPresentation; protected $htmlOutput; - public function __construct(PhpPowerpoint $oPHPPpt) + public function __construct(PhpPresentation $oPHPPpt) { - $this->oPhpPowerpoint = $oPHPPpt; + $this->oPhpPresentation = $oPHPPpt; } public function display() @@ -31,12 +31,12 @@ public function display() $this->append('
'); $this->append('
'); $this->append('
    '); - $this->displayPhpPowerpoint($this->oPhpPowerpoint); + $this->displayPhpPresentation($this->oPhpPresentation); $this->append('
'); $this->append('
'); $this->append('
'); $this->append('
'); - $this->displayPhpPowerpointInfo($this->oPhpPowerpoint); + $this->displayPhpPresentationInfo($this->oPhpPresentation); $this->append('
'); $this->append(''); $this->append(''); @@ -49,11 +49,11 @@ protected function append($sHTML) $this->htmlOutput .= $sHTML; } - protected function displayPhpPowerpoint(PhpPowerpoint $oPHPPpt) + protected function displayPhpPresentation(PhpPresentation $oPHPPpt) { - $this->append('
  • PhpPowerpoint'); + $this->append('
  • PhpPresentation'); $this->append('
      '); - $this->append('
    • Info "PhpPowerpoint"
    • '); + $this->append('
    • Info "PhpPresentation"
    • '); foreach ($oPHPPpt->getAllSlides() as $oSlide) { $this->append('
    • Slide'); $this->append('
        '); @@ -90,9 +90,9 @@ protected function displayShape(AbstractShape $shape) } } - protected function displayPhpPowerpointInfo(PhpPowerpoint $oPHPPpt) + protected function displayPhpPresentationInfo(PhpPresentation $oPHPPpt) { - $this->append('
        '); + $this->append('
        '); $this->append('
        '); $this->append('
        Number of slides
        '.$oPHPPpt->getSlideCount().'
        '); $this->append('
        Document Layout Height
        '.$oPHPPpt->getLayout()->getCY(DocumentLayout::UNIT_MILLIMETER).' mm
        '); @@ -162,10 +162,10 @@ protected function displayShapeInfo(AbstractShape $oShape) } } -$pptReader = PhpOffice\PhpPowerpoint\IOFactory::createReader('PowerPoint97'); -$oPHPPowerPoint = $pptReader->load('resources/Sample_12.ppt'); +$pptReader = PhpOffice\PhpPresentation\IOFactory::createReader('PowerPoint97'); +$oPHPPresentation = $pptReader->load('resources/Sample_12.ppt'); -$oTree = new PhpPptTree($oPHPPowerPoint); +$oTree = new PhpPptTree($oPHPPresentation); echo $oTree->display(); if (!CLI) { include_once 'Sample_Footer.php'; diff --git a/samples/Sample_Header.php b/samples/Sample_Header.php index b85f26ab3..5feac1dd3 100644 --- a/samples/Sample_Header.php +++ b/samples/Sample_Header.php @@ -2,10 +2,10 @@ /** * Header file */ -use PhpOffice\PhpPowerpoint\Autoloader; -use PhpOffice\PhpPowerpoint\Settings; -use PhpOffice\PhpPowerpoint\IOFactory; -use PhpOffice\PhpPowerpoint\Slide; +use PhpOffice\PhpPresentation\Autoloader; +use PhpOffice\PhpPresentation\Settings; +use PhpOffice\PhpPresentation\IOFactory; +use PhpOffice\PhpPresentation\Slide; error_reporting(E_ALL); define('CLI', (PHP_SAPI == 'cli') ? true : false); @@ -13,7 +13,7 @@ define('SCRIPT_FILENAME', basename($_SERVER['SCRIPT_FILENAME'], '.php')); define('IS_INDEX', SCRIPT_FILENAME == 'index'); -require_once __DIR__ . '/../src/PhpPowerpoint/Autoloader.php'; +require_once __DIR__ . '/../src/PhpPresentation/Autoloader.php'; Autoloader::register(); require_once __DIR__ . '/../vendor/autoload.php'; @@ -29,7 +29,7 @@ // Set titles and names $pageHeading = str_replace('_', ' ', SCRIPT_FILENAME); $pageTitle = IS_INDEX ? 'Welcome to ' : "{$pageHeading} - "; -$pageTitle .= 'PHPPowerPoint'; +$pageTitle .= 'PHPPresentation'; $pageHeading = IS_INDEX ? '' : "

        {$pageHeading}

        "; // Populate samples @@ -47,11 +47,11 @@ /** * Write documents * - * @param \PhpOffice\PhpPowerPoint\PhpPowerPoint $phpPowerPoint + * @param \PhpOffice\PhpPresentation\PhpPresentation $phpPresentation * @param string $filename * @param array $writers */ -function write($phpPowerPoint, $filename, $writers) +function write($phpPresentation, $filename, $writers) { $result = ''; @@ -59,7 +59,7 @@ function write($phpPowerPoint, $filename, $writers) foreach ($writers as $writer => $extension) { $result .= date('H:i:s') . " Write to {$writer} format"; if (!is_null($extension)) { - $xmlWriter = IOFactory::createWriter($phpPowerPoint, $writer); + $xmlWriter = IOFactory::createWriter($phpPresentation, $writer); $xmlWriter->save(__DIR__ . "/{$filename}.{$extension}"); rename(__DIR__ . "/{$filename}.{$extension}", __DIR__ . "/results/{$filename}.{$extension}"); } else { @@ -114,18 +114,18 @@ function getEndingNotes($writers) /** * Creates a templated slide * - * @param PHPPowerPoint $objPHPPowerPoint - * @return \PhpOffice\PhpPowerpoint\Slide + * @param PHPPresentation $objPHPPresentation + * @return \PhpOffice\PhpPresentation\Slide */ -function createTemplatedSlide(PhpOffice\PhpPowerpoint\PhpPowerpoint $objPHPPowerPoint) +function createTemplatedSlide(PhpOffice\PhpPresentation\PhpPresentation $objPHPPresentation) { // Create slide - $slide = $objPHPPowerPoint->createSlide(); + $slide = $objPHPPresentation->createSlide(); // Add logo $shape = $slide->createDrawingShape(); - $shape->setName('PHPPowerPoint logo') - ->setDescription('PHPPowerPoint logo') + $shape->setName('PHPPresentation logo') + ->setDescription('PHPPresentation logo') ->setPath('./resources/phppowerpoint_logo.gif') ->setHeight(36) ->setOffsetX(10) @@ -144,7 +144,7 @@ function createTemplatedSlide(PhpOffice\PhpPowerpoint\PhpPowerpoint $objPHPPower - +
        @@ -157,7 +157,7 @@ function createTemplatedSlide(PhpOffice\PhpPowerpoint\PhpPowerpoint $objPHPPower - PHPPowerPoint + PHPPresentation
        diff --git a/samples/Sample_X5_Templated.php b/samples/Sample_X5_Templated.php deleted file mode 100644 index fd489e2fe..000000000 --- a/samples/Sample_X5_Templated.php +++ /dev/null @@ -1,69 +0,0 @@ -getProperties()->setCreator('PHPOffice') - ->setLastModifiedBy('PHPPowerPoint Team') - ->setTitle('Sample 05 Title') - ->setSubject('Sample 05 Subject') - ->setDescription('Sample 05 Description') - ->setKeywords('office 2007 openxml libreoffice odt php') - ->setCategory('Sample Category'); - -// Create slide -echo date('H:i:s') . ' Create slide'.EOL; -$currentSlide = $objPHPPowerPoint->getActiveSlide(); - -// Create a shape (drawing) -echo date('H:i:s') . ' Create a shape (drawing)'.EOL; -$shape = $currentSlide->createDrawingShape(); -$shape->setName('PHPPowerPoint logo') - ->setDescription('PHPPowerPoint logo') - ->setPath('./resources/phppowerpoint_logo.gif') - ->setHeight(36) - ->setOffsetX(10) - ->setOffsetY(10); -$shape->getShadow()->setVisible(true) - ->setDirection(45) - ->setDistance(10); - -// Create a shape (text) -echo date('H:i:s') . ' Create a shape (rich text)'.EOL; -$shape = $currentSlide->createRichTextShape() - ->setHeight(400) - ->setWidth(600) - ->setOffsetX(170) - ->setOffsetY(180) - ->setInsetTop(50) - ->setInsetBottom(50); -$shape->getActiveParagraph()->getAlignment()->setHorizontal( Alignment::HORIZONTAL_CENTER ); -$textRun = $shape->createTextRun('Thank you for using PHPPowerPoint!'); -$textRun->getFont()->setBold(true) - ->setSize(60) - ->setColor( new Color( 'FFE06B20' ) ); -$shape->getHyperlink()->setUrl('https://github.com/PHPOffice/PHPPowerPoint/') - ->setTooltip('PHPPowerPoint'); - -// Create a shape (line) -$shape = $currentSlide->createLineShape(170, 180, 770, 180); -$shape->getBorder()->getColor()->setARGB( 'FFE06B20' ); - -// Create a shape (line) -$shape = $currentSlide->createLineShape(170, 580, 770, 580); -$shape->getBorder()->getColor()->setARGB( 'FFE06B20' ); - -// Save file -echo write($objPHPPowerPoint, basename(__FILE__, '.php'), $writers); -if (!CLI) { - include_once 'Sample_Footer.php'; -} \ No newline at end of file diff --git a/samples/bootstrap/css/phppowerpoint.css b/samples/bootstrap/css/phppresentation.css similarity index 100% rename from samples/bootstrap/css/phppowerpoint.css rename to samples/bootstrap/css/phppresentation.css diff --git a/samples/index.php b/samples/index.php index c2fbc7525..42e0c718b 100644 --- a/samples/index.php +++ b/samples/index.php @@ -11,11 +11,11 @@ if (!CLI) { ?>
        -

        Welcome to PHPPowerPoint, a library written in pure PHP that provides a set of classes to write to and read from different document file formats, i.e. Office Open XML (.pptx) and Open Document Format (.odp).

        +

        Welcome to PHPPresentation, a library written in pure PHP that provides a set of classes to write to and read from different document file formats, i.e. Office Open XML (.pptx) and Open Document Format (.odp).

         

        - Fork us on Github! - Read the Docs + Fork us on Github! + Read the Docs

        container)) { - // Add drawing to \PhpOffice\PhpPowerpoint\ShapeContainerInterface + // Add drawing to \PhpOffice\PhpPresentation\ShapeContainerInterface $this->container = $pValue; if (!is_null($this->container)) { $this->container->getShapeCollection()->append($this); } } else { if ($pOverrideOld) { - // Remove drawing from old \PhpOffice\PhpPowerpoint\ShapeContainerInterface + // Remove drawing from old \PhpOffice\PhpPresentation\ShapeContainerInterface $iterator = $this->container->getShapeCollection()->getIterator(); while ($iterator->valid()) { @@ -170,10 +170,10 @@ public function setContainer(ShapeContainerInterface $pValue = null, $pOverrideO $iterator->next(); } - // Set new \PhpOffice\PhpPowerpoint\Slide + // Set new \PhpOffice\PhpPresentation\Slide $this->setContainer($pValue); } else { - throw new \Exception("A \PhpOffice\PhpPowerpoint\ShapeContainerInterface has already been assigned. Shapes can only exist on one \PhpOffice\PhpPowerpoint\ShapeContainerInterface."); + throw new \Exception("A \PhpOffice\PhpPresentation\ShapeContainerInterface has already been assigned. Shapes can only exist on one \PhpOffice\PhpPresentation\ShapeContainerInterface."); } } @@ -310,7 +310,7 @@ public function setRotation($pValue = 0) /** * Get Fill * - * @return \PhpOffice\PhpPowerpoint\Style\Fill + * @return \PhpOffice\PhpPresentation\Style\Fill */ public function getFill() { @@ -319,8 +319,8 @@ public function getFill() /** * Set Fill - * @param \PhpOffice\PhpPowerpoint\Style\Fill $pValue - * @return \PhpOffice\PhpPowerpoint\AbstractShape + * @param \PhpOffice\PhpPresentation\Style\Fill $pValue + * @return \PhpOffice\PhpPresentation\AbstractShape */ public function setFill(Fill $pValue = null) { @@ -331,7 +331,7 @@ public function setFill(Fill $pValue = null) /** * Get Border * - * @return \PhpOffice\PhpPowerpoint\Style\Border + * @return \PhpOffice\PhpPresentation\Style\Border */ public function getBorder() { @@ -341,7 +341,7 @@ public function getBorder() /** * Get Shadow * - * @return \PhpOffice\PhpPowerpoint\Style\Shadow + * @return \PhpOffice\PhpPresentation\Style\Shadow */ public function getShadow() { @@ -351,7 +351,7 @@ public function getShadow() /** * Set Shadow * - * @param \PhpOffice\PhpPowerpoint\Style\Shadow $pValue + * @param \PhpOffice\PhpPresentation\Style\Shadow $pValue * @throws \Exception * @return self */ @@ -374,7 +374,7 @@ public function hasHyperlink() /** * Get Hyperlink * - * @return \PhpOffice\PhpPowerpoint\Shape\Hyperlink + * @return \PhpOffice\PhpPresentation\Shape\Hyperlink */ public function getHyperlink() { @@ -387,7 +387,7 @@ public function getHyperlink() /** * Set Hyperlink * - * @param \PhpOffice\PhpPowerpoint\Shape\Hyperlink $pHyperlink + * @param \PhpOffice\PhpPresentation\Shape\Hyperlink $pHyperlink * @throws \Exception * @return self */ diff --git a/src/PhpPowerpoint/Autoloader.php b/src/PhpPresentation/Autoloader.php similarity index 72% rename from src/PhpPowerpoint/Autoloader.php rename to src/PhpPresentation/Autoloader.php index 29752d9ab..605981b09 100644 --- a/src/PhpPowerpoint/Autoloader.php +++ b/src/PhpPresentation/Autoloader.php @@ -1,21 +1,21 @@ fileSupportsUnserializePHPPowerPoint($pFilename); + return $this->fileSupportsUnserializePhpPresentation($pFilename); } /** - * Does a file support UnserializePHPPowerPoint ? + * Does a file support UnserializePhpPresentation ? * * @param string $pFilename * @throws \Exception * @return boolean */ - public function fileSupportsUnserializePHPPowerPoint($pFilename = '') + public function fileSupportsUnserializePhpPresentation($pFilename = '') { // Check if file exists if (!file_exists($pFilename)) { @@ -391,37 +391,32 @@ public function fileSupportsUnserializePHPPowerPoint($pFilename = '') } /** - * Loads PHPPowerPoint Serialized file + * Loads PhpPresentation Serialized file * * @param string $pFilename - * @return \PhpOffice\PhpPowerpoint\PhpPowerpoint + * @return \PhpOffice\PhpPresentation\PhpPresentation * @throws \Exception */ public function load($pFilename) { - // Check if file exists - if (!file_exists($pFilename)) { - throw new \Exception("Could not open " . $pFilename . " for reading! File does not exist."); - } - // Unserialize... First make sure the file supports it! - if (!$this->fileSupportsUnserializePHPPowerPoint($pFilename)) { - throw new \Exception("Invalid file format for PhpOffice\PhpPowerpoint\Reader\PowerPoint97: " . $pFilename . "."); + if (!$this->fileSupportsUnserializePhpPresentation($pFilename)) { + throw new \Exception("Invalid file format for PhpOffice\PhpPresentation\Reader\PowerPoint97: " . $pFilename . "."); } return $this->loadFile($pFilename); } /** - * Load PHPPowerPoint Serialized file + * Load PhpPresentation Serialized file * * @param string $pFilename - * @return \PhpOffice\PhpPowerpoint\PhpPowerpoint + * @return \PhpOffice\PhpPresentation\PhpPresentation */ private function loadFile($pFilename) { - $this->oPhpPowerpoint = new PhpPowerpoint(); - $this->oPhpPowerpoint->removeSlideByIndex(); + $this->oPhpPresentation = new PhpPresentation(); + $this->oPhpPresentation->removeSlideByIndex(); // Read OLE Blocks $this->loadOLE($pFilename); @@ -432,7 +427,7 @@ private function loadFile($pFilename) // Read information in the PowerPoint Document Stream $this->loadPowerpointDocumentStream(); - return $this->oPhpPowerpoint; + return $this->oPhpPresentation; } /** @@ -1608,7 +1603,7 @@ private function readRecordOfficeArtSpgrContainer($stream, $pos, $bInGroup = fal switch ($rhFileBlock['recType']) { case 0xF003: // Core - $this->oCurrentGroup = $this->oPhpPowerpoint->getActiveSlide()->createGroup(); + $this->oCurrentGroup = $this->oPhpPresentation->getActiveSlide()->createGroup(); $this->bFirstShapeGroup = false; // OfficeArtSpgrContainer $fileBlock = $this->readRecordOfficeArtSpgrContainer($stream, $pos + $arrayReturn['length'], true); @@ -1630,7 +1625,7 @@ private function readRecordOfficeArtSpgrContainer($stream, $pos, $bInGroup = fal if ($bInGroup) { $this->oCurrentGroup->addShape($fileBlock['shape']); } else { - $this->oPhpPowerpoint->getActiveSlide()->addShape($fileBlock['shape']); + $this->oPhpPresentation->getActiveSlide()->addShape($fileBlock['shape']); } } @@ -2557,8 +2552,8 @@ private function readRecordSlideAtom($stream, $pos) private function readRecordSlideContainer($stream, $pos) { // Core - $this->oPhpPowerpoint->createSlide(); - $this->oPhpPowerpoint->setActiveSlideIndex($this->oPhpPowerpoint->getSlideCount() - 1); + $this->oPhpPresentation->createSlide(); + $this->oPhpPresentation->setActiveSlideIndex($this->oPhpPresentation->getSlideCount() - 1); // *** slideAtom (32 bytes) $slideAtom = $this->readRecordSlideAtom($stream, $pos); diff --git a/src/PhpPowerpoint/Reader/ReaderInterface.php b/src/PhpPresentation/Reader/ReaderInterface.php similarity index 54% rename from src/PhpPowerpoint/Reader/ReaderInterface.php rename to src/PhpPresentation/Reader/ReaderInterface.php index ac173f514..2a4157e7d 100644 --- a/src/PhpPowerpoint/Reader/ReaderInterface.php +++ b/src/PhpPresentation/Reader/ReaderInterface.php @@ -1,21 +1,21 @@ fileSupportsUnserializePHPPowerPoint($pFilename); + return $this->fileSupportsUnserializePhpPresentation($pFilename); } /** - * Does a file support UnserializePHPPowerPoint ? + * Does a file support UnserializePhpPresentation ? * * @param string $pFilename * @throws \Exception * @return boolean */ - public function fileSupportsUnserializePHPPowerPoint($pFilename = '') + public function fileSupportsUnserializePhpPresentation($pFilename = '') { // Check if file exists if (!file_exists($pFilename)) { throw new \Exception("Could not open " . $pFilename . " for reading! File does not exist."); } - // File exists, does it contain PHPPowerPoint.xml? - return File::fileExists("zip://$pFilename#PHPPowerPoint.xml"); + // File exists, does it contain PhpPresentation.xml? + return File::fileExists("zip://$pFilename#PhpPresentation.xml"); } /** - * Loads PHPPowerPoint Serialized file + * Loads PhpPresentation Serialized file * * @param string $pFilename - * @return \PhpOffice\PhpPowerpoint\PhpPowerpoint + * @return \PhpOffice\PhpPresentation\PhpPresentation * @throws \Exception */ public function load($pFilename) @@ -70,24 +70,24 @@ public function load($pFilename) } // Unserialize... First make sure the file supports it! - if (!$this->fileSupportsUnserializePHPPowerPoint($pFilename)) { - throw new \Exception("Invalid file format for PhpOffice\PhpPowerpoint\Reader\Serialized: " . $pFilename . "."); + if (!$this->fileSupportsUnserializePhpPresentation($pFilename)) { + throw new \Exception("Invalid file format for PhpOffice\PhpPresentation\Reader\Serialized: " . $pFilename . "."); } return $this->loadSerialized($pFilename); } /** - * Load PHPPowerPoint Serialized file + * Load PhpPresentation Serialized file * * @param string $pFilename - * @return \PhpOffice\PhpPowerpoint\PhpPowerpoint + * @return \PhpOffice\PhpPresentation\PhpPresentation */ private function loadSerialized($pFilename) { $oArchive = new \ZipArchive(); if ($oArchive->open($pFilename) === true) { - $xmlContent = $oArchive->getFromName('PHPPowerPoint.xml'); + $xmlContent = $oArchive->getFromName('PhpPresentation.xml'); if (!empty($xmlContent)) { $xmlData = simplexml_load_string($xmlContent); diff --git a/src/PhpPowerpoint/Shape/AbstractDrawing.php b/src/PhpPresentation/Shape/AbstractDrawing.php similarity index 83% rename from src/PhpPowerpoint/Shape/AbstractDrawing.php rename to src/PhpPresentation/Shape/AbstractDrawing.php index b5e915a36..1a11119e9 100644 --- a/src/PhpPowerpoint/Shape/AbstractDrawing.php +++ b/src/PhpPresentation/Shape/AbstractDrawing.php @@ -1,24 +1,24 @@ setResizeProportional(true); * @example $objDrawing->setWidthAndHeight(160,120); - * @return \PhpOffice\PhpPowerpoint\Shape\AbstractDrawing + * @return \PhpOffice\PhpPresentation\Shape\AbstractDrawing */ public function setWidthAndHeight($width = 0, $height = 0) { @@ -228,7 +228,7 @@ public function isResizeProportional() * Set ResizeProportional * * @param boolean $pValue - * @return \PhpOffice\PhpPowerpoint\Shape\AbstractDrawing + * @return \PhpOffice\PhpPresentation\Shape\AbstractDrawing */ public function setResizeProportional($pValue = true) { diff --git a/src/PhpPowerpoint/Shape/Chart.php b/src/PhpPresentation/Shape/Chart.php similarity index 67% rename from src/PhpPowerpoint/Shape/Chart.php rename to src/PhpPresentation/Shape/Chart.php index 46cbffac0..73a7ed690 100644 --- a/src/PhpPowerpoint/Shape/Chart.php +++ b/src/PhpPresentation/Shape/Chart.php @@ -1,27 +1,27 @@ richTextParagraphs as $p) { $returnValue .= $p->getPlainText(); } @@ -327,7 +327,7 @@ public function __toString() /** * Get paragraphs * - * @return \PhpOffice\PhpPowerpoint\Shape\RichText\Paragraph[] + * @return \PhpOffice\PhpPresentation\Shape\RichText\Paragraph[] */ public function getParagraphs() { @@ -337,9 +337,9 @@ public function getParagraphs() /** * Set paragraphs * - * @param \PhpOffice\PhpPowerpoint\Shape\RichText\Paragraph[] $paragraphs Array of paragraphs + * @param \PhpOffice\PhpPresentation\Shape\RichText\Paragraph[] $paragraphs Array of paragraphs * @throws \Exception - * @return \PhpOffice\PhpPowerpoint\Shape\RichText + * @return \PhpOffice\PhpPresentation\Shape\RichText */ public function setParagraphs($paragraphs = null) { @@ -347,7 +347,7 @@ public function setParagraphs($paragraphs = null) $this->richTextParagraphs = $paragraphs; $this->activeParagraph = count($this->richTextParagraphs) - 1; } else { - throw new \Exception("Invalid \PhpOffice\PhpPowerpoint\Shape\RichText\Paragraph[] array passed."); + throw new \Exception("Invalid \PhpOffice\PhpPresentation\Shape\RichText\Paragraph[] array passed."); } return $this; @@ -367,7 +367,7 @@ public function getWrap() * Set text wrapping * * @param $value string - * @return \PhpOffice\PhpPowerpoint\Shape\RichText + * @return \PhpOffice\PhpPresentation\Shape\RichText */ public function setWrap($value = self::WRAP_SQUARE) { @@ -412,7 +412,7 @@ public function getLineSpaceReduction() * @param $value string * @param $fontScale float * @param $lnSpcReduction float - * @return \PhpOffice\PhpPowerpoint\Shape\RichText + * @return \PhpOffice\PhpPresentation\Shape\RichText */ public function setAutoFit($value = self::AUTOFIT_DEFAULT, $fontScale = null, $lnSpcReduction = null) { @@ -443,7 +443,7 @@ public function getHorizontalOverflow() * Set horizontal overflow * * @param $value string - * @return \PhpOffice\PhpPowerpoint\Shape\RichText + * @return \PhpOffice\PhpPresentation\Shape\RichText */ public function setHorizontalOverflow($value = self::OVERFLOW_OVERFLOW) { @@ -466,7 +466,7 @@ public function getVerticalOverflow() * Set vertical overflow * * @param $value string - * @return \PhpOffice\PhpPowerpoint\Shape\RichText + * @return \PhpOffice\PhpPresentation\Shape\RichText */ public function setVerticalOverflow($value = self::OVERFLOW_OVERFLOW) { @@ -489,7 +489,7 @@ public function isUpright() * Set vertical * * @param $value boolean - * @return \PhpOffice\PhpPowerpoint\Shape\RichText + * @return \PhpOffice\PhpPresentation\Shape\RichText */ public function setUpright($value = false) { @@ -512,7 +512,7 @@ public function isVertical() * Set vertical * * @param $value boolean - * @return \PhpOffice\PhpPowerpoint\Shape\RichText + * @return \PhpOffice\PhpPresentation\Shape\RichText */ public function setVertical($value = false) { @@ -536,7 +536,7 @@ public function getColumns() * * @param $value int * @throws \Exception - * @return \PhpOffice\PhpPowerpoint\Shape\RichText + * @return \PhpOffice\PhpPresentation\Shape\RichText */ public function setColumns($value = 1) { @@ -563,7 +563,7 @@ public function getInsetBottom() * Set bottom inset * * @param $value float - * @return \PhpOffice\PhpPowerpoint\Shape\RichText + * @return \PhpOffice\PhpPresentation\Shape\RichText */ public function setInsetBottom($value = 4.8) { @@ -586,7 +586,7 @@ public function getInsetLeft() * Set left inset * * @param $value float - * @return \PhpOffice\PhpPowerpoint\Shape\RichText + * @return \PhpOffice\PhpPresentation\Shape\RichText */ public function setInsetLeft($value = 9.6) { @@ -609,7 +609,7 @@ public function getInsetRight() * Set left inset * * @param $value float - * @return \PhpOffice\PhpPowerpoint\Shape\RichText + * @return \PhpOffice\PhpPresentation\Shape\RichText */ public function setInsetRight($value = 9.6) { @@ -632,7 +632,7 @@ public function getInsetTop() * Set top inset * * @param $value float - * @return \PhpOffice\PhpPowerpoint\Shape\RichText + * @return \PhpOffice\PhpPresentation\Shape\RichText */ public function setInsetTop($value = 4.8) { diff --git a/src/PhpPowerpoint/Shape/RichText/BreakElement.php b/src/PhpPresentation/Shape/RichText/BreakElement.php similarity index 63% rename from src/PhpPowerpoint/Shape/RichText/BreakElement.php rename to src/PhpPresentation/Shape/RichText/BreakElement.php index 0543c3171..4b5d37367 100644 --- a/src/PhpPowerpoint/Shape/RichText/BreakElement.php +++ b/src/PhpPresentation/Shape/RichText/BreakElement.php @@ -1,21 +1,21 @@ richTextElements as $text) { if ($text instanceof TextElementInterface) { $returnValue .= $text->getText(); @@ -238,7 +238,7 @@ public function __toString() /** * Get Rich Text elements * - * @return \PhpOffice\PhpPowerpoint\Shape\RichText\TextElementInterface[] + * @return \PhpOffice\PhpPresentation\Shape\RichText\TextElementInterface[] */ public function getRichTextElements() { @@ -248,16 +248,16 @@ public function getRichTextElements() /** * Set Rich Text elements * - * @param \PhpOffice\PhpPowerpoint\Shape\RichText\TextElementInterface[] $pElements Array of elements + * @param \PhpOffice\PhpPresentation\Shape\RichText\TextElementInterface[] $pElements Array of elements * @throws \Exception - * @return \PhpOffice\PhpPowerpoint\Shape\RichText\Paragraph + * @return \PhpOffice\PhpPresentation\Shape\RichText\Paragraph */ public function setRichTextElements($pElements = null) { if (is_array($pElements)) { $this->richTextElements = $pElements; } else { - throw new \Exception("Invalid \PhpOffice\PhpPowerpoint\Shape\RichText\TextElementInterface[] array passed."); + throw new \Exception("Invalid \PhpOffice\PhpPresentation\Shape\RichText\TextElementInterface[] array passed."); } return $this; diff --git a/src/PhpPowerpoint/Shape/RichText/Run.php b/src/PhpPresentation/Shape/RichText/Run.php similarity index 60% rename from src/PhpPowerpoint/Shape/RichText/Run.php rename to src/PhpPresentation/Shape/RichText/Run.php index ba124c80d..97455c0f1 100644 --- a/src/PhpPowerpoint/Shape/RichText/Run.php +++ b/src/PhpPresentation/Shape/RichText/Run.php @@ -1,23 +1,23 @@ richTextParagraphs as $p) { $returnValue .= $p->getPlainText(); } @@ -258,7 +258,7 @@ public function __toString() /** * Get paragraphs * - * @return \PhpOffice\PhpPowerpoint\Shape\RichText\Paragraph[] + * @return \PhpOffice\PhpPresentation\Shape\RichText\Paragraph[] */ public function getParagraphs() { @@ -268,9 +268,9 @@ public function getParagraphs() /** * Set paragraphs * - * @param \PhpOffice\PhpPowerpoint\Shape\RichText\Paragraph[] $paragraphs Array of paragraphs + * @param \PhpOffice\PhpPresentation\Shape\RichText\Paragraph[] $paragraphs Array of paragraphs * @throws \Exception - * @return \PhpOffice\PhpPowerpoint\Shape\RichText + * @return \PhpOffice\PhpPresentation\Shape\RichText */ public function setParagraphs($paragraphs = null) { @@ -278,7 +278,7 @@ public function setParagraphs($paragraphs = null) $this->richTextParagraphs = $paragraphs; $this->activeParagraph = count($this->richTextParagraphs) - 1; } else { - throw new \Exception("Invalid \PhpOffice\PhpPowerpoint\Shape\RichText\Paragraph[] array passed."); + throw new \Exception("Invalid \PhpOffice\PhpPresentation\Shape\RichText\Paragraph[] array passed."); } return $this; @@ -287,7 +287,7 @@ public function setParagraphs($paragraphs = null) /** * Get fill * - * @return \PhpOffice\PhpPowerpoint\Style\Fill + * @return \PhpOffice\PhpPresentation\Style\Fill */ public function getFill() { @@ -297,8 +297,8 @@ public function getFill() /** * Set fill * - * @param \PhpOffice\PhpPowerpoint\Style\Fill $fill - * @return \PhpOffice\PhpPowerpoint\Shape\RichText + * @param \PhpOffice\PhpPresentation\Style\Fill $fill + * @return \PhpOffice\PhpPresentation\Shape\RichText */ public function setFill(Fill $fill) { @@ -310,7 +310,7 @@ public function setFill(Fill $fill) /** * Get borders * - * @return \PhpOffice\PhpPowerpoint\Style\Borders + * @return \PhpOffice\PhpPresentation\Style\Borders */ public function getBorders() { @@ -320,8 +320,8 @@ public function getBorders() /** * Set borders * - * @param \PhpOffice\PhpPowerpoint\Style\Borders $borders - * @return \PhpOffice\PhpPowerpoint\Shape\RichText + * @param \PhpOffice\PhpPresentation\Style\Borders $borders + * @return \PhpOffice\PhpPresentation\Shape\RichText */ public function setBorders(Borders $borders) { @@ -344,7 +344,7 @@ public function getWidth() * Set width * * @param int $value - * @return \PhpOffice\PhpPowerpoint\Shape\RichText + * @return \PhpOffice\PhpPresentation\Shape\RichText */ public function setWidth($value = 0) { @@ -367,7 +367,7 @@ public function getColSpan() * Set colSpan * * @param int $value - * @return \PhpOffice\PhpPowerpoint\Shape\RichText + * @return \PhpOffice\PhpPresentation\Shape\RichText */ public function setColSpan($value = 0) { @@ -390,7 +390,7 @@ public function getRowSpan() * Set rowSpan * * @param int $value - * @return \PhpOffice\PhpPowerpoint\Shape\RichText + * @return \PhpOffice\PhpPresentation\Shape\RichText */ public function setRowSpan($value = 0) { diff --git a/src/PhpPowerpoint/Shape/Table/Row.php b/src/PhpPresentation/Shape/Table/Row.php similarity index 77% rename from src/PhpPowerpoint/Shape/Table/Row.php rename to src/PhpPresentation/Shape/Table/Row.php index 48b9d589e..4f427f02d 100644 --- a/src/PhpPowerpoint/Shape/Table/Row.php +++ b/src/PhpPresentation/Shape/Table/Row.php @@ -1,24 +1,24 @@ parent = $pParent; @@ -136,7 +136,7 @@ public function __construct(PhpPowerpoint $pParent = null) /** * Get collection of shapes * - * @return \ArrayObject|\PhpOffice\PhpPowerpoint\AbstractShape[] + * @return \ArrayObject|\PhpOffice\PhpPresentation\AbstractShape[] */ public function getShapeCollection() { @@ -146,8 +146,8 @@ public function getShapeCollection() /** * Add shape to slide * - * @param \PhpOffice\PhpPowerpoint\AbstractShape $shape - * @return \PhpOffice\PhpPowerpoint\AbstractShape + * @param \PhpOffice\PhpPresentation\AbstractShape $shape + * @return \PhpOffice\PhpPresentation\AbstractShape */ public function addShape(AbstractShape $shape) { @@ -159,7 +159,7 @@ public function addShape(AbstractShape $shape) /** * Create rich text shape * - * @return \PhpOffice\PhpPowerpoint\Shape\RichText + * @return \PhpOffice\PhpPresentation\Shape\RichText */ public function createRichTextShape() { @@ -176,7 +176,7 @@ public function createRichTextShape() * @param int $fromY Starting point y offset * @param int $toX Ending point x offset * @param int $toY Ending point y offset - * @return \PhpOffice\PhpPowerpoint\Shape\Line + * @return \PhpOffice\PhpPresentation\Shape\Line */ public function createLineShape($fromX, $fromY, $toX, $toY) { @@ -189,7 +189,7 @@ public function createLineShape($fromX, $fromY, $toX, $toY) /** * Create chart shape * - * @return \PhpOffice\PhpPowerpoint\Shape\Chart + * @return \PhpOffice\PhpPresentation\Shape\Chart */ public function createChartShape() { @@ -202,7 +202,7 @@ public function createChartShape() /** * Create drawing shape * - * @return \PhpOffice\PhpPowerpoint\Shape\Drawing + * @return \PhpOffice\PhpPresentation\Shape\Drawing */ public function createDrawingShape() { @@ -216,7 +216,7 @@ public function createDrawingShape() * Create table shape * * @param int $columns Number of columns - * @return \PhpOffice\PhpPowerpoint\Shape\Table + * @return \PhpOffice\PhpPresentation\Shape\Table */ public function createTableShape($columns = 1) { @@ -229,7 +229,7 @@ public function createTableShape($columns = 1) /** * Creates a group within this slide * - * @return \PhpOffice\PhpPowerpoint\Shape\Group + * @return \PhpOffice\PhpPresentation\Shape\Group */ public function createGroup() { @@ -242,7 +242,7 @@ public function createGroup() /** * Get parent * - * @return PHPPowerPoint + * @return PhpPresentation */ public function getParent() { @@ -252,10 +252,10 @@ public function getParent() /** * Re-bind parent * - * @param \PhpOffice\PhpPowerpoint\PhpPowerpoint $parent - * @return \PhpOffice\PhpPowerpoint\Slide + * @param \PhpOffice\PhpPresentation\PhpPresentation $parent + * @return \PhpOffice\PhpPresentation\Slide */ - public function rebindParent(PhpPowerpoint $parent) + public function rebindParent(PhpPresentation $parent) { $this->parent->removeSlideByIndex($this->parent->getIndex($this)); $this->parent = $parent; @@ -277,7 +277,7 @@ public function getSlideLayout() * Set slide layout * * @param string $layout - * @return \PhpOffice\PhpPowerpoint\Slide + * @return \PhpOffice\PhpPresentation\Slide */ public function setSlideLayout($layout = Layout::BLANK) { @@ -300,7 +300,7 @@ public function getSlideMasterId() * Set slide master id * * @param int $masterId - * @return \PhpOffice\PhpPowerpoint\Slide + * @return \PhpOffice\PhpPresentation\Slide */ public function setSlideMasterId($masterId = 1) { @@ -348,7 +348,7 @@ public function setHashIndex($value) /** * Copy slide (!= clone!) * - * @return \PhpOffice\PhpPowerpoint\Slide + * @return \PhpOffice\PhpPresentation\Slide */ public function copy() { @@ -419,7 +419,7 @@ public function getExtentY() /** * - * @return \PhpOffice\PhpPowerpoint\Slide\Note + * @return \PhpOffice\PhpPresentation\Slide\Note */ public function getNote() { @@ -431,8 +431,8 @@ public function getNote() /** * - * @param \PhpOffice\PhpPowerpoint\Slide\Note $note - * @return \PhpOffice\PhpPowerpoint\Slide + * @param \PhpOffice\PhpPresentation\Slide\Note $note + * @return \PhpOffice\PhpPresentation\Slide */ public function setNote(Note $note = null) { @@ -444,7 +444,7 @@ public function setNote(Note $note = null) /** * - * @return \PhpOffice\PhpPowerpoint\Slide\Transition + * @return \PhpOffice\PhpPresentation\Slide\Transition */ public function getTransition() { @@ -453,8 +453,8 @@ public function getTransition() /** * - * @param \PhpOffice\PhpPowerpoint\Slide\Transition $transition - * @return \PhpOffice\PhpPowerpoint\Slide + * @param \PhpOffice\PhpPresentation\Slide\Transition $transition + * @return \PhpOffice\PhpPresentation\Slide */ public function setTransition(Transition $transition = null) { diff --git a/src/PhpPowerpoint/Slide/Iterator.php b/src/PhpPresentation/Slide/Iterator.php similarity index 62% rename from src/PhpPowerpoint/Slide/Iterator.php rename to src/PhpPresentation/Slide/Iterator.php index a1aba3ff6..72043c1d4 100644 --- a/src/PhpPowerpoint/Slide/Iterator.php +++ b/src/PhpPresentation/Slide/Iterator.php @@ -1,35 +1,35 @@ subject = $subject; @@ -68,9 +68,9 @@ public function rewind() } /** - * Current \PhpOffice\PhpPowerpoint\Slide + * Current \PhpOffice\PhpPresentation\Slide * - * @return \PhpOffice\PhpPowerpoint\Slide + * @return \PhpOffice\PhpPresentation\Slide */ public function current() { @@ -96,7 +96,7 @@ public function next() } /** - * More \PhpOffice\PhpPowerpoint\Slide instances available? + * More \PhpOffice\PhpPresentation\Slide instances available? * * @return boolean */ diff --git a/src/PhpPowerpoint/Slide/Layout.php b/src/PhpPresentation/Slide/Layout.php similarity index 67% rename from src/PhpPowerpoint/Slide/Layout.php rename to src/PhpPresentation/Slide/Layout.php index 16b289291..b4fc02767 100644 --- a/src/PhpPowerpoint/Slide/Layout.php +++ b/src/PhpPresentation/Slide/Layout.php @@ -1,24 +1,24 @@ setPHPPowerPoint($pPHPPowerPoint); + // Assign PhpPresentation + $this->setPhpPresentation($pPhpPresentation); // Set up disk caching location $this->diskCachingDirectory = './'; @@ -107,7 +107,7 @@ public function __construct(PhpPowerpoint $pPHPPowerPoint = null) } /** - * Save PHPPowerPoint to file + * Save PhpPresentation to file * * @param string $pFilename * @throws \Exception @@ -129,31 +129,31 @@ public function save($pFilename) $writerPartChart = $this->getWriterPart('charts'); if (!$writerPartChart instanceof ObjectsChart) { - throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPowerpoint\Writer\ODPresentation\ObjectsChart'); + throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPresentation\Writer\ODPresentation\ObjectsChart'); } $writerPartContent = $this->getWriterPart('content'); if (!$writerPartContent instanceof Content) { - throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPowerpoint\Writer\ODPresentation\Content'); + throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPresentation\Writer\ODPresentation\Content'); } $writerPartDrawing = $this->getWriterPart('Drawing'); if (!$writerPartDrawing instanceof Drawing) { - throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPowerpoint\Writer\ODPresentation\Drawing'); + throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPresentation\Writer\ODPresentation\Drawing'); } $writerPartManifest = $this->getWriterPart('manifest'); if (!$writerPartManifest instanceof Manifest) { - throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPowerpoint\Writer\ODPresentation\Manifest'); + throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPresentation\Writer\ODPresentation\Manifest'); } $writerPartMeta = $this->getWriterPart('meta'); if (!$writerPartMeta instanceof Meta) { - throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPowerpoint\Writer\ODPresentation\Meta'); + throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPresentation\Writer\ODPresentation\Meta'); } $writerPartMimetype = $this->getWriterPart('mimetype'); if (!$writerPartMimetype instanceof Mimetype) { - throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPowerpoint\Writer\ODPresentation\Mimetype'); + throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPresentation\Writer\ODPresentation\Mimetype'); } $writerPartStyles = $this->getWriterPart('styles'); if (!$writerPartStyles instanceof Styles) { - throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPowerpoint\Writer\ODPresentation\Styles'); + throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPresentation\Writer\ODPresentation\Styles'); } // Create drawing dictionary @@ -200,7 +200,7 @@ public function save($pFilename) for ($i = 0; $i < $this->getDrawingHashTable()->count(); ++$i) { $shape = $this->getDrawingHashTable()->getByIndex($i); if (!($shape instanceof AbstractDrawing)) { - throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPowerpoint\Shape\AbstractDrawing'); + throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPresentation\Shape\AbstractDrawing'); } if ($shape instanceof ShapeDrawing) { if (!in_array(md5($shape->getPath()), $arrMedia)) { @@ -251,35 +251,35 @@ public function save($pFilename) } } } else { - throw new \Exception("PHPPowerPoint object unassigned."); + throw new \Exception("PhpPresentation object unassigned."); } } /** - * Get PHPPowerPoint object + * Get PhpPresentation object * - * @return PhpPowerpoint + * @return PhpPresentation * @throws \Exception */ - public function getPHPPowerPoint() + public function getPhpPresentation() { if (!is_null($this->presentation)) { return $this->presentation; } else { - throw new \Exception("No PHPPowerPoint assigned."); + throw new \Exception("No PhpPresentation assigned."); } } /** - * Get PHPPowerPoint object + * Get PhpPresentation object * - * @param PhpPowerpoint $pPHPPowerPoint PhpPowerpoint object + * @param PhpPresentation $pPhpPresentation PhpPresentation object * @throws \Exception - * @return \PhpOffice\PhpPowerpoint\Writer\PowerPoint2007 + * @return \PhpOffice\PhpPresentation\Writer\ODPresentation */ - public function setPHPPowerPoint(PhpPowerpoint $pPHPPowerPoint = null) + public function setPhpPresentation(PhpPresentation $pPhpPresentation = null) { - $this->presentation = $pPHPPowerPoint; + $this->presentation = $pPhpPresentation; return $this; } @@ -287,7 +287,7 @@ public function setPHPPowerPoint(PhpPowerpoint $pPHPPowerPoint = null) /** * Get drawing hash table * - * @return \PhpOffice\PhpPowerpoint\HashTable + * @return \PhpOffice\PhpPresentation\HashTable */ public function getDrawingHashTable() { @@ -298,7 +298,7 @@ public function getDrawingHashTable() * Get writer part * * @param string $pPartName Writer part name - * @return \PhpOffice\PhpPowerpoint\Writer\ODPresentation\AbstractPart + * @return \PhpOffice\PhpPresentation\Writer\ODPresentation\AbstractPart */ public function getWriterPart($pPartName = '') { @@ -325,7 +325,7 @@ public function hasDiskCaching() * @param boolean $pValue * @param string $pDirectory Disk caching directory * @throws \Exception - * @return \PhpOffice\PhpPowerpoint\Writer\PowerPoint2007 + * @return \PhpOffice\PhpPresentation\Writer\ODPresentation */ public function setUseDiskCaching($pValue = false, $pDirectory = null) { diff --git a/src/PhpPowerpoint/Writer/ODPresentation/AbstractPart.php b/src/PhpPresentation/Writer/ODPresentation/AbstractPart.php similarity index 57% rename from src/PhpPowerpoint/Writer/ODPresentation/AbstractPart.php rename to src/PhpPresentation/Writer/ODPresentation/AbstractPart.php index 9c8b94c0c..636b6b001 100644 --- a/src/PhpPowerpoint/Writer/ODPresentation/AbstractPart.php +++ b/src/PhpPresentation/Writer/ODPresentation/AbstractPart.php @@ -1,45 +1,45 @@ parentWriter)) { return $this->parentWriter; } else { - throw new \Exception("No parent \PhpOffice\PhpPowerpoint\Writer\WriterInterface assigned."); + throw new \Exception("No parent \PhpOffice\PhpPresentation\Writer\WriterInterface assigned."); } } @@ -69,7 +69,7 @@ protected function getXMLWriter() { $parentWriter = $this->getParentWriter(); if (!$parentWriter instanceof ODPresentation) { - throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPowerpoint\Writer\ODPresentation'); + throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPresentation\Writer\ODPresentation'); } if ($parentWriter->hasDiskCaching()) { return new XMLWriter(XMLWriter::STORAGE_DISK, $parentWriter->getDiskCachingDirectory()); diff --git a/src/PhpPowerpoint/Writer/ODPresentation/Content.php b/src/PhpPresentation/Writer/ODPresentation/Content.php similarity index 96% rename from src/PhpPowerpoint/Writer/ODPresentation/Content.php rename to src/PhpPresentation/Writer/ODPresentation/Content.php index 181d206e2..027604216 100644 --- a/src/PhpPowerpoint/Writer/ODPresentation/Content.php +++ b/src/PhpPresentation/Writer/ODPresentation/Content.php @@ -1,48 +1,48 @@ getXMLWriter(); @@ -129,7 +129,7 @@ public function writePart(PhpPowerpoint $pPHPPowerPoint) $this->shapeId = 0; $incSlide = 0; - foreach ($pPHPPowerPoint->getAllSlides() as $pSlide) { + foreach ($pPhpPresentation->getAllSlides() as $pSlide) { // Slides $this->writeStyleSlide($objWriter, $pSlide, $incSlide); @@ -263,10 +263,10 @@ public function writePart(PhpPowerpoint $pPHPPowerPoint) $objWriter->startElement('office:presentation'); // Write slides - $slideCount = $pPHPPowerPoint->getSlideCount(); + $slideCount = $pPhpPresentation->getSlideCount(); $this->shapeId = 0; for ($i = 0; $i < $slideCount; ++$i) { - $pSlide = $pPHPPowerPoint->getSlide($i); + $pSlide = $pPhpPresentation->getSlide($i); $objWriter->startElement('draw:page'); $objWriter->writeAttribute('draw:name', 'page' . $i); $objWriter->writeAttribute('draw:master-page-name', 'Standard'); @@ -311,7 +311,7 @@ public function writePart(PhpPowerpoint $pPHPPowerPoint) * Write picture * * @param \PhpOffice\Common\XMLWriter $objWriter - * @param \PhpOffice\PhpPowerpoint\Shape\AbstractDrawing $shape + * @param \PhpOffice\PhpPresentation\Shape\AbstractDrawing $shape */ public function writeShapePic(XMLWriter $objWriter, AbstractDrawing $shape) { @@ -360,7 +360,7 @@ public function writeShapePic(XMLWriter $objWriter, AbstractDrawing $shape) * Write text * * @param \PhpOffice\Common\XMLWriter $objWriter - * @param \PhpOffice\PhpPowerpoint\Shape\RichText $shape + * @param \PhpOffice\PhpPresentation\Shape\RichText $shape */ public function writeShapeTxt(XMLWriter $objWriter, RichText $shape) { @@ -634,7 +634,7 @@ public function writeShapeChart(XMLWriter $objWriter, Chart $shape) { $parentWriter = $this->getParentWriter(); if (!$parentWriter instanceof ODPresentation) { - throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPowerpoint\Writer\ODPresentation'); + throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPresentation\Writer\ODPresentation'); } $parentWriter->chartArray[$this->shapeId] = $shape; @@ -726,7 +726,7 @@ public function writeGroupStyle(XMLWriter $objWriter, Group $group) * Write the default style information for a RichText shape * * @param \PhpOffice\Common\XMLWriter $objWriter - * @param \PhpOffice\PhpPowerpoint\Shape\RichText $shape + * @param \PhpOffice\PhpPresentation\Shape\RichText $shape */ public function writeTxtStyle(XMLWriter $objWriter, RichText $shape) { @@ -837,7 +837,7 @@ public function writeTxtStyle(XMLWriter $objWriter, RichText $shape) * Write the default style information for an AbstractDrawing * * @param \PhpOffice\Common\XMLWriter $objWriter - * @param \PhpOffice\PhpPowerpoint\Shape\AbstractDrawing $shape + * @param \PhpOffice\PhpPresentation\Shape\AbstractDrawing $shape */ public function writeDrawingStyle(XMLWriter $objWriter, AbstractDrawing $shape) { @@ -1005,7 +1005,7 @@ public function writeTableStyle(XMLWriter $objWriter, Table $shape) /** * Write the slide note * @param XMLWriter $objWriter - * @param \PhpOffice\PhpPowerpoint\Slide\Note $note + * @param \PhpOffice\PhpPresentation\Slide\Note $note */ public function writeSlideNote(XMLWriter $objWriter, Note $note) { diff --git a/src/PhpPowerpoint/Writer/PowerPoint2007/Drawing.php b/src/PhpPresentation/Writer/ODPresentation/Drawing.php similarity index 57% rename from src/PhpPowerpoint/Writer/PowerPoint2007/Drawing.php rename to src/PhpPresentation/Writer/ODPresentation/Drawing.php index 0f59a733d..1f9fc003b 100644 --- a/src/PhpPowerpoint/Writer/PowerPoint2007/Drawing.php +++ b/src/PhpPresentation/Writer/ODPresentation/Drawing.php @@ -1,49 +1,49 @@ getSlideCount(); + // Loop trough PhpPresentation + $slideCount = $pPhpPresentation->getSlideCount(); for ($i = 0; $i < $slideCount; ++$i) { // Loop trough images and add to array - $iterator = $pPHPPowerPoint->getSlide($i)->getShapeCollection()->getIterator(); + $iterator = $pPhpPresentation->getSlide($i)->getShapeCollection()->getIterator(); while ($iterator->valid()) { if ($iterator->current() instanceof AbstractDrawing && !($iterator->current() instanceof Table)) { $aDrawings[] = $iterator->current(); diff --git a/src/PhpPowerpoint/Writer/ODPresentation/Manifest.php b/src/PhpPresentation/Writer/ODPresentation/Manifest.php similarity index 87% rename from src/PhpPowerpoint/Writer/ODPresentation/Manifest.php rename to src/PhpPresentation/Writer/ODPresentation/Manifest.php index 64c65fda3..9408aed8d 100644 --- a/src/PhpPowerpoint/Writer/ODPresentation/Manifest.php +++ b/src/PhpPresentation/Writer/ODPresentation/Manifest.php @@ -1,30 +1,30 @@ getParentWriter(); if (!$parentWriter instanceof ODPresentation) { - throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPowerpoint\Writer\ODPresentation'); + throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPresentation\Writer\ODPresentation'); } // Create XML writer diff --git a/src/PhpPowerpoint/Writer/ODPresentation/Meta.php b/src/PhpPresentation/Writer/ODPresentation/Meta.php similarity index 62% rename from src/PhpPowerpoint/Writer/ODPresentation/Meta.php rename to src/PhpPresentation/Writer/ODPresentation/Meta.php index c9d7da689..75fe0e463 100644 --- a/src/PhpPowerpoint/Writer/ODPresentation/Meta.php +++ b/src/PhpPresentation/Writer/ODPresentation/Meta.php @@ -1,37 +1,37 @@ getXMLWriter(); @@ -58,25 +58,25 @@ public function writePart(PHPPowerPoint $pPHPPowerPoint) $objWriter->startElement('office:meta'); // dc:creator - $objWriter->writeElement('dc:creator', $pPHPPowerPoint->getProperties()->getLastModifiedBy()); + $objWriter->writeElement('dc:creator', $pPhpPresentation->getProperties()->getLastModifiedBy()); // dc:date - $objWriter->writeElement('dc:date', gmdate('Y-m-d\TH:i:s.000', $pPHPPowerPoint->getProperties()->getModified())); + $objWriter->writeElement('dc:date', gmdate('Y-m-d\TH:i:s.000', $pPhpPresentation->getProperties()->getModified())); // dc:description - $objWriter->writeElement('dc:description', $pPHPPowerPoint->getProperties()->getDescription()); + $objWriter->writeElement('dc:description', $pPhpPresentation->getProperties()->getDescription()); // dc:subject - $objWriter->writeElement('dc:subject', $pPHPPowerPoint->getProperties()->getSubject()); + $objWriter->writeElement('dc:subject', $pPhpPresentation->getProperties()->getSubject()); // dc:title - $objWriter->writeElement('dc:title', $pPHPPowerPoint->getProperties()->getTitle()); + $objWriter->writeElement('dc:title', $pPhpPresentation->getProperties()->getTitle()); // meta:creation-date - $objWriter->writeElement('meta:creation-date', gmdate('Y-m-d\TH:i:s.000', $pPHPPowerPoint->getProperties()->getCreated())); + $objWriter->writeElement('meta:creation-date', gmdate('Y-m-d\TH:i:s.000', $pPhpPresentation->getProperties()->getCreated())); // meta:initial-creator - $objWriter->writeElement('meta:initial-creator', $pPHPPowerPoint->getProperties()->getCreator()); + $objWriter->writeElement('meta:initial-creator', $pPhpPresentation->getProperties()->getCreator()); // meta:keyword - $objWriter->writeElement('meta:keyword', $pPHPPowerPoint->getProperties()->getKeywords()); + $objWriter->writeElement('meta:keyword', $pPhpPresentation->getProperties()->getKeywords()); // @todo : Where these properties are written ? - // $pPHPPowerPoint->getProperties()->getCategory() - // $pPHPPowerPoint->getProperties()->getCompany() + // $pPhpPresentation->getProperties()->getCategory() + // $pPhpPresentation->getProperties()->getCompany() $objWriter->endElement(); diff --git a/src/PhpPowerpoint/Writer/ODPresentation/Mimetype.php b/src/PhpPresentation/Writer/ODPresentation/Mimetype.php similarity index 54% rename from src/PhpPowerpoint/Writer/ODPresentation/Mimetype.php rename to src/PhpPresentation/Writer/ODPresentation/Mimetype.php index be6bf7aa2..16a9fb9ec 100644 --- a/src/PhpPowerpoint/Writer/ODPresentation/Mimetype.php +++ b/src/PhpPresentation/Writer/ODPresentation/Mimetype.php @@ -1,26 +1,26 @@ getXMLWriter(); @@ -96,7 +96,7 @@ public function writePart(PHPPowerPoint $pPHPPowerPoint) $objWriter->writeAttribute('office:version', '1.2'); // Variables - $stylePageLayout = $pPHPPowerPoint->getLayout()->getDocumentLayout(); + $stylePageLayout = $pPhpPresentation->getLayout()->getDocumentLayout(); // office:styles $objWriter->startElement('office:styles'); @@ -113,7 +113,7 @@ public function writePart(PHPPowerPoint $pPHPPowerPoint) // > style:style $objWriter->endElement(); - foreach ($pPHPPowerPoint->getAllSlides() as $slide) { + foreach ($pPhpPresentation->getAllSlides() as $slide) { foreach ($slide->getShapeCollection() as $shape) { if ($shape instanceof Table) { $this->writeTableStyle($objWriter, $shape); @@ -142,9 +142,9 @@ public function writePart(PHPPowerPoint $pPHPPowerPoint) $objWriter->writeAttribute('fo:margin-bottom', '0cm'); $objWriter->writeAttribute('fo:margin-left', '0cm'); $objWriter->writeAttribute('fo:margin-right', '0cm'); - $objWriter->writeAttribute('fo:page-width', Text::numberFormat(CommonDrawing::pixelsToCentimeters(CommonDrawing::emuToPixels($pPHPPowerPoint->getLayout()->getCX())), 1) . 'cm'); - $objWriter->writeAttribute('fo:page-height', Text::numberFormat(CommonDrawing::pixelsToCentimeters(CommonDrawing::emuToPixels($pPHPPowerPoint->getLayout()->getCY())), 1) . 'cm'); - if ($pPHPPowerPoint->getLayout()->getCX() > $pPHPPowerPoint->getLayout()->getCY()) { + $objWriter->writeAttribute('fo:page-width', Text::numberFormat(CommonDrawing::pixelsToCentimeters(CommonDrawing::emuToPixels($pPhpPresentation->getLayout()->getCX())), 1) . 'cm'); + $objWriter->writeAttribute('fo:page-height', Text::numberFormat(CommonDrawing::pixelsToCentimeters(CommonDrawing::emuToPixels($pPhpPresentation->getLayout()->getCY())), 1) . 'cm'); + if ($pPhpPresentation->getLayout()->getCX() > $pPhpPresentation->getLayout()->getCY()) { $objWriter->writeAttribute('style:print-orientation', 'landscape'); } else { $objWriter->writeAttribute('style:print-orientation', 'portrait'); diff --git a/src/PhpPowerpoint/Writer/PowerPoint2007.php b/src/PhpPresentation/Writer/PowerPoint2007.php similarity index 80% rename from src/PhpPowerpoint/Writer/PowerPoint2007.php rename to src/PhpPresentation/Writer/PowerPoint2007.php index d5faa7806..360a1a302 100644 --- a/src/PhpPowerpoint/Writer/PowerPoint2007.php +++ b/src/PhpPresentation/Writer/PowerPoint2007.php @@ -1,41 +1,41 @@ setPHPPowerPoint($pPHPPowerPoint); + // Assign PhpPresentation + $this->setPhpPresentation($pPhpPresentation); // Set up disk caching location $this->diskCachingDir = './'; @@ -128,7 +128,7 @@ public function __construct(PhpPowerpoint $pPHPPowerPoint = null) * Get writer part * * @param string $pPartName Writer part name - * @return \PhpOffice\PhpPowerpoint\Writer\PowerPoint2007\AbstractPart + * @return \PhpOffice\PhpPresentation\Writer\PowerPoint2007\AbstractPart */ public function getWriterPart($pPartName = '') { @@ -140,7 +140,7 @@ public function getWriterPart($pPartName = '') } /** - * Save PHPPowerPoint to file + * Save PhpPresentation to file * * @param string $pFilename * @throws \Exception @@ -162,39 +162,39 @@ public function save($pFilename) $wPartDrawing = $this->getWriterPart('Drawing'); if (!$wPartDrawing instanceof Drawing) { - throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPowerpoint\Writer\PowerPoint2007\Drawing'); + throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPresentation\Writer\PowerPoint2007\Drawing'); } $wPartContentTypes = $this->getWriterPart('ContentTypes'); if (!$wPartContentTypes instanceof ContentTypes) { - throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPowerpoint\Writer\PowerPoint2007\ContentTypes'); + throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPresentation\Writer\PowerPoint2007\ContentTypes'); } $wPartRels = $this->getWriterPart('Rels'); if (!$wPartRels instanceof Rels) { - throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPowerpoint\Writer\PowerPoint2007\Rels'); + throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPresentation\Writer\PowerPoint2007\Rels'); } $wPartDocProps = $this->getWriterPart('DocProps'); if (!$wPartDocProps instanceof DocProps) { - throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPowerpoint\Writer\PowerPoint2007\DocProps'); + throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPresentation\Writer\PowerPoint2007\DocProps'); } $wPartTheme = $this->getWriterPart('Theme'); if (!$wPartTheme instanceof Theme) { - throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPowerpoint\Writer\PowerPoint2007\Theme'); + throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPresentation\Writer\PowerPoint2007\Theme'); } $wPartPresentation = $this->getWriterPart('Presentation'); if (!$wPartPresentation instanceof Presentation) { - throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPowerpoint\Writer\PowerPoint2007\Presentation'); + throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPresentation\Writer\PowerPoint2007\Presentation'); } $wPartSlide = $this->getWriterPart('Slide'); if (!$wPartSlide instanceof Slide) { - throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPowerpoint\Writer\PowerPoint2007\Slide'); + throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPresentation\Writer\PowerPoint2007\Slide'); } $wPartChart = $this->getWriterPart('Chart'); if (!$wPartChart instanceof Chart) { - throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPowerpoint\Writer\PowerPoint2007\Chart'); + throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPresentation\Writer\PowerPoint2007\Chart'); } $wPptProps = $this->getWriterPart('PptProps'); if (!$wPptProps instanceof PptProps) { - throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPowerpoint\Writer\PowerPoint2007\PptProps'); + throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPresentation\Writer\PowerPoint2007\PptProps'); } // Create drawing dictionary @@ -329,35 +329,35 @@ public function save($pFilename) } } } else { - throw new \Exception("PHPPowerPoint object unassigned."); + throw new \Exception("PhpPresentation object unassigned."); } } /** - * Get PHPPowerPoint object + * Get PhpPresentation object * - * @return PHPPowerPoint + * @return PhpPresentation * @throws \Exception */ - public function getPHPPowerPoint() + public function getPhpPresentation() { if (!is_null($this->presentation)) { return $this->presentation; } else { - throw new \Exception("No PHPPowerPoint assigned."); + throw new \Exception("No PhpPresentation assigned."); } } /** - * Get PHPPowerPoint object + * Get PhpPresentation object * - * @param PhpPowerpoint $pPHPPowerPoint PhpPowerpoint object + * @param PhpPresentation $pPhpPresentation PhpPresentation object * @throws \Exception - * @return \PhpOffice\PhpPowerpoint\Writer\PowerPoint2007 + * @return \PhpOffice\PhpPresentation\Writer\PowerPoint2007 */ - public function setPHPPowerPoint(PhpPowerpoint $pPHPPowerPoint = null) + public function setPhpPresentation(PhpPresentation $pPhpPresentation = null) { - $this->presentation = $pPHPPowerPoint; + $this->presentation = $pPhpPresentation; return $this; } @@ -365,7 +365,7 @@ public function setPHPPowerPoint(PhpPowerpoint $pPHPPowerPoint = null) /** * Get hash table * - * @return \PhpOffice\PhpPowerpoint\HashTable + * @return \PhpOffice\PhpPresentation\HashTable */ public function getDrawingHashTable() { @@ -386,7 +386,7 @@ public function hasOffice2003Compatibility() * Set Pre-Calculate Formulas * * @param boolean $pValue Office2003 compatibility? - * @return \PhpOffice\PhpPowerpoint\Writer\PowerPoint2007 + * @return \PhpOffice\PhpPresentation\Writer\PowerPoint2007 */ public function setOffice2003Compatibility($pValue = false) { @@ -411,7 +411,7 @@ public function hasDiskCaching() * @param boolean $pValue * @param string $pDirectory Disk caching directory * @throws \Exception - * @return \PhpOffice\PhpPowerpoint\Writer\PowerPoint2007 + * @return \PhpOffice\PhpPresentation\Writer\PowerPoint2007 */ public function setUseDiskCaching($pValue = false, $pDirectory = null) { @@ -441,7 +441,7 @@ public function getDiskCachingDirectory() /** * Get layout pack to use * - * @return \PhpOffice\PhpPowerpoint\Writer\PowerPoint2007\AbstractLayoutPack + * @return \PhpOffice\PhpPresentation\Writer\PowerPoint2007\AbstractLayoutPack */ public function getLayoutPack() { @@ -451,8 +451,8 @@ public function getLayoutPack() /** * Set layout pack to use * - * @param \PhpOffice\PhpPowerpoint\Writer\PowerPoint2007\AbstractLayoutPack $pValue - * @return \PhpOffice\PhpPowerpoint\Writer\PowerPoint2007 + * @param \PhpOffice\PhpPresentation\Writer\PowerPoint2007\AbstractLayoutPack $pValue + * @return \PhpOffice\PhpPresentation\Writer\PowerPoint2007 */ public function setLayoutPack(AbstractLayoutPack $pValue = null) { diff --git a/src/PhpPowerpoint/Writer/PowerPoint2007/AbstractLayoutPack.php b/src/PhpPresentation/Writer/PowerPoint2007/AbstractLayoutPack.php similarity index 89% rename from src/PhpPowerpoint/Writer/PowerPoint2007/AbstractLayoutPack.php rename to src/PhpPresentation/Writer/PowerPoint2007/AbstractLayoutPack.php index abfd57ad8..5ff54f0cb 100644 --- a/src/PhpPowerpoint/Writer/PowerPoint2007/AbstractLayoutPack.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/AbstractLayoutPack.php @@ -1,24 +1,24 @@ parentWriter)) { return $this->parentWriter; } else { - throw new \Exception("No parent \PhpOffice\PhpPowerpoint\Writer\WriterInterface assigned."); + throw new \Exception("No parent \PhpOffice\PhpPresentation\Writer\WriterInterface assigned."); } } @@ -66,7 +66,7 @@ protected function getXMLWriter() { $parentWriter = $this->getParentWriter(); if (!$parentWriter instanceof PowerPoint2007) { - throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPowerpoint\Writer\PowerPoint2007'); + throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPresentation\Writer\PowerPoint2007'); } if ($parentWriter->hasDiskCaching()) { return new XMLWriter(XMLWriter::STORAGE_DISK, $parentWriter->getDiskCachingDirectory()); diff --git a/src/PhpPowerpoint/Writer/PowerPoint2007/Chart.php b/src/PhpPresentation/Writer/PowerPoint2007/Chart.php similarity index 96% rename from src/PhpPowerpoint/Writer/PowerPoint2007/Chart.php rename to src/PhpPresentation/Writer/PowerPoint2007/Chart.php index 0ccd8d565..d94a18516 100644 --- a/src/PhpPowerpoint/Writer/PowerPoint2007/Chart.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/Chart.php @@ -1,49 +1,49 @@ hasIncludedSpreadsheet()) { @@ -385,7 +385,7 @@ protected function writeMultipleValuesOrReference($objWriter, $isReference, $val * Write Title * * @param \PhpOffice\Common\XMLWriter $objWriter XML Writer - * @param \PhpOffice\PhpPowerpoint\Shape\Chart\Title $subject + * @param \PhpOffice\PhpPresentation\Shape\Chart\Title $subject * @throws \Exception */ protected function writeTitle(XMLWriter $objWriter, Title $subject) @@ -493,8 +493,8 @@ protected function writeTitle(XMLWriter $objWriter, Title $subject) * Write Plot Area * * @param \PhpOffice\Common\XMLWriter $objWriter XML Writer - * @param \PhpOffice\PhpPowerpoint\Shape\Chart\PlotArea $subject - * @param \PhpOffice\PhpPowerpoint\Shape\Chart $chart + * @param \PhpOffice\PhpPresentation\Shape\Chart\PlotArea $subject + * @param \PhpOffice\PhpPresentation\Shape\Chart $chart * @throws \Exception */ protected function writePlotArea(XMLWriter $objWriter, PlotArea $subject, ShapeChart $chart) @@ -748,7 +748,7 @@ protected function writePlotArea(XMLWriter $objWriter, PlotArea $subject, ShapeC * Write Legend * * @param \PhpOffice\Common\XMLWriter $objWriter XML Writer - * @param \PhpOffice\PhpPowerpoint\Shape\Chart\Legend $subject + * @param \PhpOffice\PhpPresentation\Shape\Chart\Legend $subject * @throws \Exception */ protected function writeLegend(XMLWriter $objWriter, Legend $subject) @@ -912,7 +912,7 @@ protected function writeLayout(XMLWriter $objWriter, $subject) * Write Type Line * * @param \PhpOffice\Common\XMLWriter $objWriter XML Writer - * @param \PhpOffice\PhpPowerpoint\Shape\Chart\Type\Area $subject + * @param \PhpOffice\PhpPresentation\Shape\Chart\Type\Area $subject * @param boolean $includeSheet * @throws \Exception */ @@ -1088,7 +1088,7 @@ protected function writeTypeArea(XMLWriter $objWriter, Area $subject, $includeSh * Write Type Bar3D * * @param \PhpOffice\Common\XMLWriter $objWriter XML Writer - * @param \PhpOffice\PhpPowerpoint\Shape\Chart\Type\Bar $subject + * @param \PhpOffice\PhpPresentation\Shape\Chart\Type\Bar $subject * @param boolean $includeSheet * @throws \Exception */ @@ -1313,7 +1313,7 @@ protected function writeTypeBar(XMLWriter $objWriter, Bar $subject, $includeShee * Write Type Bar3D * * @param \PhpOffice\Common\XMLWriter $objWriter XML Writer - * @param \PhpOffice\PhpPowerpoint\Shape\Chart\Type\Bar3D $subject + * @param \PhpOffice\PhpPresentation\Shape\Chart\Type\Bar3D $subject * @param boolean $includeSheet * @throws \Exception */ @@ -1520,8 +1520,8 @@ protected function writeTypeBar3D(XMLWriter $objWriter, Bar3D $subject, $include /** * Write Type Pie * - * @param \PhpOffice\PhpPowerpoint\Shared\XMLWriter $objWriter XML Writer - * @param \PhpOffice\PhpPowerpoint\Shape\Chart\Type\Pie $subject + * @param \PhpOffice\PhpPresentation\Shared\XMLWriter $objWriter XML Writer + * @param \PhpOffice\PhpPresentation\Shape\Chart\Type\Pie $subject * @param boolean $includeSheet * @throws \Exception */ @@ -1690,7 +1690,7 @@ protected function writeTypePie(XMLWriter $objWriter, Pie $subject, $includeShee * Write Type Pie3D * * @param \PhpOffice\Common\XMLWriter $objWriter XML Writer - * @param \PhpOffice\PhpPowerpoint\Shape\Chart\Type\Pie3D $subject + * @param \PhpOffice\PhpPresentation\Shape\Chart\Type\Pie3D $subject * @param boolean $includeSheet * @throws \Exception */ @@ -1864,7 +1864,7 @@ protected function writeTypePie3D(XMLWriter $objWriter, Pie3D $subject, $include * Write Type Line * * @param \PhpOffice\Common\XMLWriter $objWriter XML Writer - * @param \PhpOffice\PhpPowerpoint\Shape\Chart\Type\Line $subject + * @param \PhpOffice\PhpPresentation\Shape\Chart\Type\Line $subject * @param boolean $includeSheet * @throws \Exception */ @@ -2039,7 +2039,7 @@ protected function writeTypeLine(XMLWriter $objWriter, Line $subject, $includeSh * Write Type Scatter * * @param \PhpOffice\Common\XMLWriter $objWriter XML Writer - * @param \PhpOffice\PhpPowerpoint\Shape\Chart\Type\Scatter $subject + * @param \PhpOffice\PhpPresentation\Shape\Chart\Type\Scatter $subject * @param boolean $includeSheet * @throws \Exception */ diff --git a/src/PhpPowerpoint/Writer/PowerPoint2007/ContentTypes.php b/src/PhpPresentation/Writer/PowerPoint2007/ContentTypes.php similarity index 89% rename from src/PhpPowerpoint/Writer/PowerPoint2007/ContentTypes.php rename to src/PhpPresentation/Writer/PowerPoint2007/ContentTypes.php index 69f179681..8c90bdb80 100644 --- a/src/PhpPowerpoint/Writer/PowerPoint2007/ContentTypes.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/ContentTypes.php @@ -1,47 +1,47 @@ getParentWriter(); if (!$parentWriter instanceof PowerPoint2007) { - throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPowerpoint\Writer\PowerPoint2007'); + throw new \Exception('The $parentWriter is not an instance of \PhpOffice\PhpPresentation\Writer\PowerPoint2007'); } // Create XML writer $objWriter = $this->getXMLWriter(); @@ -91,10 +91,10 @@ public function writeContentTypes(PhpPowerpoint $pPHPPowerPoint) } // Slides - $slideCount = $pPHPPowerPoint->getSlideCount(); + $slideCount = $pPhpPresentation->getSlideCount(); for ($i = 0; $i < $slideCount; ++$i) { $this->writeOverrideContentType($objWriter, '/ppt/slides/slide' . ($i + 1) . '.xml', 'application/vnd.openxmlformats-officedocument.presentationml.slide+xml'); - if ($pPHPPowerPoint->getSlide($i)->getNote()->getShapeCollection()->count() > 0) { + if ($pPhpPresentation->getSlide($i)->getNote()->getShapeCollection()->count() > 0) { $this->writeOverrideContentType($objWriter, '/ppt/notesSlides/notesSlide' . ($i + 1) . '.xml', 'application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml'); } } diff --git a/src/PhpPowerpoint/Writer/PowerPoint2007/DocProps.php b/src/PhpPresentation/Writer/PowerPoint2007/DocProps.php similarity index 70% rename from src/PhpPowerpoint/Writer/PowerPoint2007/DocProps.php rename to src/PhpPresentation/Writer/PowerPoint2007/DocProps.php index 3cae3cafb..966b49965 100644 --- a/src/PhpPowerpoint/Writer/PowerPoint2007/DocProps.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/DocProps.php @@ -1,37 +1,37 @@ getXMLWriter(); @@ -48,7 +48,7 @@ public function writeDocPropsApp(PhpPowerpoint $pPHPPowerPoint) $objWriter->writeElement('Application', 'Microsoft Office PowerPoint'); // Slides - $objWriter->writeElement('Slides', $pPHPPowerPoint->getSlideCount()); + $objWriter->writeElement('Slides', $pPhpPresentation->getSlideCount()); // ScaleCrop $objWriter->writeElement('ScaleCrop', 'false'); @@ -100,7 +100,7 @@ public function writeDocPropsApp(PhpPowerpoint $pPHPPowerPoint) $objWriter->endElement(); // Company - $objWriter->writeElement('Company', $pPHPPowerPoint->getProperties()->getCompany()); + $objWriter->writeElement('Company', $pPhpPresentation->getProperties()->getCompany()); // LinksUpToDate $objWriter->writeElement('LinksUpToDate', 'false'); @@ -123,11 +123,11 @@ public function writeDocPropsApp(PhpPowerpoint $pPHPPowerPoint) /** * Write docProps/core.xml to XML format * - * @param PhpPowerpoint $pPHPPowerPoint + * @param PhpPresentation $pPhpPresentation * @return string XML Output * @throws \Exception */ - public function writeDocPropsCore(PhpPowerpoint $pPHPPowerPoint) + public function writeDocPropsCore(PhpPresentation $pPhpPresentation) { // Create XML writer $objWriter = $this->getXMLWriter(); @@ -144,37 +144,37 @@ public function writeDocPropsCore(PhpPowerpoint $pPHPPowerPoint) $objWriter->writeAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); // dc:creator - $objWriter->writeElement('dc:creator', $pPHPPowerPoint->getProperties()->getCreator()); + $objWriter->writeElement('dc:creator', $pPhpPresentation->getProperties()->getCreator()); // cp:lastModifiedBy - $objWriter->writeElement('cp:lastModifiedBy', $pPHPPowerPoint->getProperties()->getLastModifiedBy()); + $objWriter->writeElement('cp:lastModifiedBy', $pPhpPresentation->getProperties()->getLastModifiedBy()); // dcterms:created $objWriter->startElement('dcterms:created'); $objWriter->writeAttribute('xsi:type', 'dcterms:W3CDTF'); - $objWriter->writeRaw(gmdate("Y-m-d\TH:i:s\Z", $pPHPPowerPoint->getProperties()->getCreated())); + $objWriter->writeRaw(gmdate("Y-m-d\TH:i:s\Z", $pPhpPresentation->getProperties()->getCreated())); $objWriter->endElement(); // dcterms:modified $objWriter->startElement('dcterms:modified'); $objWriter->writeAttribute('xsi:type', 'dcterms:W3CDTF'); - $objWriter->writeRaw(gmdate("Y-m-d\TH:i:s\Z", $pPHPPowerPoint->getProperties()->getModified())); + $objWriter->writeRaw(gmdate("Y-m-d\TH:i:s\Z", $pPhpPresentation->getProperties()->getModified())); $objWriter->endElement(); // dc:title - $objWriter->writeElement('dc:title', $pPHPPowerPoint->getProperties()->getTitle()); + $objWriter->writeElement('dc:title', $pPhpPresentation->getProperties()->getTitle()); // dc:description - $objWriter->writeElement('dc:description', $pPHPPowerPoint->getProperties()->getDescription()); + $objWriter->writeElement('dc:description', $pPhpPresentation->getProperties()->getDescription()); // dc:subject - $objWriter->writeElement('dc:subject', $pPHPPowerPoint->getProperties()->getSubject()); + $objWriter->writeElement('dc:subject', $pPhpPresentation->getProperties()->getSubject()); // cp:keywords - $objWriter->writeElement('cp:keywords', $pPHPPowerPoint->getProperties()->getKeywords()); + $objWriter->writeElement('cp:keywords', $pPhpPresentation->getProperties()->getKeywords()); // cp:category - $objWriter->writeElement('cp:category', $pPHPPowerPoint->getProperties()->getCategory()); + $objWriter->writeElement('cp:category', $pPhpPresentation->getProperties()->getCategory()); $objWriter->endElement(); diff --git a/src/PhpPowerpoint/Writer/ODPresentation/Drawing.php b/src/PhpPresentation/Writer/PowerPoint2007/Drawing.php similarity index 57% rename from src/PhpPowerpoint/Writer/ODPresentation/Drawing.php rename to src/PhpPresentation/Writer/PowerPoint2007/Drawing.php index 74f33422c..4acd2087b 100644 --- a/src/PhpPowerpoint/Writer/ODPresentation/Drawing.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/Drawing.php @@ -1,49 +1,49 @@ getSlideCount(); + // Loop trough PhpPresentation + $slideCount = $pPhpPresentation->getSlideCount(); for ($i = 0; $i < $slideCount; ++$i) { // Loop trough images and add to array - $iterator = $pPHPPowerPoint->getSlide($i)->getShapeCollection()->getIterator(); + $iterator = $pPhpPresentation->getSlide($i)->getShapeCollection()->getIterator(); while ($iterator->valid()) { if ($iterator->current() instanceof AbstractDrawing && !($iterator->current() instanceof Table)) { $aDrawings[] = $iterator->current(); diff --git a/src/PhpPowerpoint/Writer/PowerPoint2007/LayoutPack/PackDefault.php b/src/PhpPresentation/Writer/PowerPoint2007/LayoutPack/PackDefault.php similarity index 99% rename from src/PhpPowerpoint/Writer/PowerPoint2007/LayoutPack/PackDefault.php rename to src/PhpPresentation/Writer/PowerPoint2007/LayoutPack/PackDefault.php index c37a67964..db5b13355 100644 --- a/src/PhpPowerpoint/Writer/PowerPoint2007/LayoutPack/PackDefault.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/LayoutPack/PackDefault.php @@ -1,32 +1,32 @@ masterSlides, array( - "\PhpOffice\PhpPowerpoint\Writer\PowerPoint2007\LayoutPack\TemplateBased", + "\PhpOffice\PhpPresentation\Writer\PowerPoint2007\LayoutPack\TemplateBased", "cmpMaster" )); diff --git a/src/PhpPowerpoint/Writer/PowerPoint2007/PptProps.php b/src/PhpPresentation/Writer/PowerPoint2007/PptProps.php similarity index 89% rename from src/PhpPowerpoint/Writer/PowerPoint2007/PptProps.php rename to src/PhpPresentation/Writer/PowerPoint2007/PptProps.php index ad5d268aa..27dd316ff 100644 --- a/src/PhpPowerpoint/Writer/PowerPoint2007/PptProps.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/PptProps.php @@ -1,23 +1,23 @@ getXMLWriter(); @@ -77,15 +77,15 @@ public function writePresentation(PhpPowerpoint $pPHPPowerPoint) // p:sldIdLst $objWriter->startElement('p:sldIdLst'); - $this->writeSlides($objWriter, $pPHPPowerPoint, $relationId); + $this->writeSlides($objWriter, $pPhpPresentation, $relationId); $objWriter->endElement(); // p:sldSz $objWriter->startElement('p:sldSz'); - $objWriter->writeAttribute('cx', $pPHPPowerPoint->getLayout()->getCX()); - $objWriter->writeAttribute('cy', $pPHPPowerPoint->getLayout()->getCY()); - if ($pPHPPowerPoint->getLayout()->getDocumentLayout() != DocumentLayout::LAYOUT_CUSTOM) { - $objWriter->writeAttribute('type', $pPHPPowerPoint->getLayout()->getDocumentLayout()); + $objWriter->writeAttribute('cx', $pPhpPresentation->getLayout()->getCX()); + $objWriter->writeAttribute('cy', $pPhpPresentation->getLayout()->getCY()); + if ($pPhpPresentation->getLayout()->getDocumentLayout() != DocumentLayout::LAYOUT_CUSTOM) { + $objWriter->writeAttribute('type', $pPhpPresentation->getLayout()->getDocumentLayout()); } $objWriter->endElement(); @@ -105,14 +105,14 @@ public function writePresentation(PhpPowerpoint $pPHPPowerPoint) * Write slides * * @param \PhpOffice\Common\XMLWriter $objWriter XML Writer - * @param PhpPowerpoint $pPHPPowerPoint + * @param PhpPresentation $pPhpPresentation * @param int $startRelationId * @throws \Exception */ - private function writeSlides(XMLWriter $objWriter, PhpPowerpoint $pPHPPowerPoint, $startRelationId = 2) + private function writeSlides(XMLWriter $objWriter, PhpPresentation $pPhpPresentation, $startRelationId = 2) { // Write slides - $slideCount = $pPHPPowerPoint->getSlideCount(); + $slideCount = $pPhpPresentation->getSlideCount(); for ($i = 0; $i < $slideCount; ++$i) { // p:sldId $this->writeSlide($objWriter, ($i + 256), ($i + $startRelationId)); diff --git a/src/PhpPowerpoint/Writer/PowerPoint2007/Rels.php b/src/PhpPresentation/Writer/PowerPoint2007/Rels.php similarity index 94% rename from src/PhpPowerpoint/Writer/PowerPoint2007/Rels.php rename to src/PhpPresentation/Writer/PowerPoint2007/Rels.php index 2452dee6d..b72f28eeb 100644 --- a/src/PhpPowerpoint/Writer/PowerPoint2007/Rels.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/Rels.php @@ -1,37 +1,37 @@ getXMLWriter(); @@ -105,7 +105,7 @@ public function writePresentationRelationships(PhpPowerpoint $pPHPPowerPoint) $this->writeRelationship($objWriter, $relationId++, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme', 'theme/theme1.xml'); // Relationships with slides - $slideCount = $pPHPPowerPoint->getSlideCount(); + $slideCount = $pPhpPresentation->getSlideCount(); for ($i = 0; $i < $slideCount; ++$i) { $this->writeRelationship($objWriter, $relationId++, 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide', 'slides/slide' . ($i + 1) . '.xml'); } @@ -259,7 +259,7 @@ public function writeThemeRelationships($masterId = 1) /** * Write slide relationships to XML format * - * @param \PhpOffice\PhpPowerpoint\Slide $pSlide + * @param \PhpOffice\PhpPresentation\Slide $pSlide * @return string XML Output * @throws \Exception */ @@ -510,7 +510,7 @@ public function writeSlideRelationships(SlideElement $pSlide) /** * Write chart relationships to XML format * - * @param \PhpOffice\PhpPowerpoint\Shape\Chart $pChart + * @param \PhpOffice\PhpPresentation\Shape\Chart $pChart * @return string XML Output * @throws \Exception */ diff --git a/src/PhpPowerpoint/Writer/PowerPoint2007/Slide.php b/src/PhpPresentation/Writer/PowerPoint2007/Slide.php similarity index 96% rename from src/PhpPowerpoint/Writer/PowerPoint2007/Slide.php rename to src/PhpPresentation/Writer/PowerPoint2007/Slide.php index 951b27bee..fb0983770 100644 --- a/src/PhpPowerpoint/Writer/PowerPoint2007/Slide.php +++ b/src/PhpPresentation/Writer/PowerPoint2007/Slide.php @@ -1,42 +1,42 @@ setPHPPowerPoint($pPHPPowerPoint); + // Assign PhpPresentation + $this->setPhpPresentation($pPhpPresentation); } /** - * Save PHPPowerPoint to file + * Save PhpPresentation to file * * @param string $pFilename * @throws \Exception @@ -77,66 +77,66 @@ public function save($pFilename) } } - // Add PHPPowerPoint.xml to the document, which represents a PHP serialized PHPPowerPoint object - $objZip->addFromString('PHPPowerPoint.xml', $this->writeSerialized($this->presentation, $pFilename)); + // Add PhpPresentation.xml to the document, which represents a PHP serialized PhpPresentation object + $objZip->addFromString('PhpPresentation.xml', $this->writeSerialized($this->presentation, $pFilename)); // Close file if ($objZip->close() === false) { throw new \Exception("Could not close zip file $pFilename."); } } else { - throw new \Exception("PHPPowerPoint object unassigned."); + throw new \Exception("PhpPresentation object unassigned."); } } /** - * Get PHPPowerPoint object + * Get PhpPresentation object * - * @return PHPPowerPoint + * @return PhpPresentation * @throws \Exception */ - public function getPHPPowerPoint() + public function getPhpPresentation() { if (!is_null($this->presentation)) { return $this->presentation; } else { - throw new \Exception("No PHPPowerPoint assigned."); + throw new \Exception("No PhpPresentation assigned."); } } /** - * Get PHPPowerPoint object + * Get PhpPresentation object * - * @param PHPPowerPoint $pPHPPowerPoint PHPPowerPoint object + * @param PhpPresentation $pPhpPresentation PhpPresentation object * @throws \Exception - * @return \PhpOffice\PhpPowerpoint\Writer\Serialized + * @return \PhpOffice\PhpPresentation\Writer\Serialized */ - public function setPHPPowerPoint(PhpPowerpoint $pPHPPowerPoint = null) + public function setPhpPresentation(PhpPresentation $pPhpPresentation = null) { - $this->presentation = $pPHPPowerPoint; + $this->presentation = $pPhpPresentation; return $this; } /** - * Serialize PHPPowerPoint object to XML + * Serialize PhpPresentation object to XML * - * @param PHPPowerPoint $pPHPPowerPoint + * @param PhpPresentation $pPhpPresentation * @param string $pFilename * @return string XML Output * @throws \Exception */ - private function writeSerialized(PhpPowerpoint $pPHPPowerPoint = null, $pFilename = '') + private function writeSerialized(PhpPresentation $pPhpPresentation = null, $pFilename = '') { - // Clone $pPHPPowerPoint - $pPHPPowerPoint = clone $pPHPPowerPoint; + // Clone $pPhpPresentation + $pPhpPresentation = clone $pPhpPresentation; // Update media links - $slideCount = $pPHPPowerPoint->getSlideCount(); + $slideCount = $pPhpPresentation->getSlideCount(); for ($i = 0; $i < $slideCount; ++$i) { - for ($j = 0; $j < $pPHPPowerPoint->getSlide($i)->getShapeCollection()->count(); ++$j) { - if ($pPHPPowerPoint->getSlide($i)->getShapeCollection()->offsetGet($j) instanceof AbstractDrawing) { - $pPHPPowerPoint->getSlide($i)->getShapeCollection()->offsetGet($j)->setPath('zip://' . $pFilename . '#media/' . $pPHPPowerPoint->getSlide($i)->getShapeCollection()->offsetGet($j)->getFilename(), false); + for ($j = 0; $j < $pPhpPresentation->getSlide($i)->getShapeCollection()->count(); ++$j) { + if ($pPhpPresentation->getSlide($i)->getShapeCollection()->offsetGet($j) instanceof AbstractDrawing) { + $pPhpPresentation->getSlide($i)->getShapeCollection()->offsetGet($j)->setPath('zip://' . $pFilename . '#media/' . $pPhpPresentation->getSlide($i)->getShapeCollection()->offsetGet($j)->getFilename(), false); } } } @@ -149,16 +149,16 @@ private function writeSerialized(PhpPowerpoint $pPHPPowerPoint = null, $pFilenam // XML header $objWriter->startDocument('1.0', 'UTF-8', 'yes'); - // PHPPowerPoint - $objWriter->startElement('PHPPowerPoint'); + // PhpPresentation + $objWriter->startElement('PhpPresentation'); $objWriter->writeAttribute('version', '##VERSION##'); // Comment - $objWriter->writeComment('This file has been generated using PHPPowerPoint v##VERSION## (http://github.com/PHPOffice/PHPPowerPoint). It contains a base64 encoded serialized version of the PHPPowerPoint internal object.'); + $objWriter->writeComment('This file has been generated using PhpPresentation v##VERSION## (http://github.com/PHPOffice/PhpPresentation). It contains a base64 encoded serialized version of the PhpPresentation internal object.'); // Data $objWriter->startElement('data'); - $objWriter->writeCData(base64_encode(serialize($pPHPPowerPoint))); + $objWriter->writeCData(base64_encode(serialize($pPhpPresentation))); $objWriter->endElement(); $objWriter->endElement(); diff --git a/src/PhpPowerpoint/Writer/WriterInterface.php b/src/PhpPresentation/Writer/WriterInterface.php similarity index 54% rename from src/PhpPowerpoint/Writer/WriterInterface.php rename to src/PhpPresentation/Writer/WriterInterface.php index abd0c924d..bf63a35cf 100644 --- a/src/PhpPowerpoint/Writer/WriterInterface.php +++ b/src/PhpPresentation/Writer/WriterInterface.php @@ -1,21 +1,21 @@ assertEquals(0, $object->getOffsetX()); - $this->assertEquals(0, $object->getOffsetY()); - $this->assertEquals(0, $object->getHeight()); - $this->assertEquals(0, $object->getRotation()); - $this->assertEquals(0, $object->getWidth()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Border', $object->getBorder()); - $this->assertEquals(Border::LINE_NONE, $object->getBorder()->getLineStyle()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Fill', $object->getFill()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Shadow', $object->getShadow()); - } - - public function testFill() - { - $object = new RichText(); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setFill()); - $this->assertNull($object->getFill()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setFill(new Fill())); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Fill', $object->getFill()); - } - - public function testHeight() - { - $object = new RichText(); - - $value = rand(1, 100); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setHeight()); - $this->assertEquals(0, $object->getHeight()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setHeight($value)); - $this->assertEquals($value, $object->getHeight()); - } - - public function testHyperlink() - { - $object = new RichText(); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setHyperlink()); - $this->assertFalse($object->hasHyperlink()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Hyperlink', $object->getHyperlink()); - $this->assertTrue($object->hasHyperlink()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setHyperlink(new Hyperlink('http://www.google.fr'))); - $this->assertTrue($object->hasHyperlink()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Hyperlink', $object->getHyperlink()); - $this->assertTrue($object->hasHyperlink()); - } - - public function testOffsetX() - { - $object = new RichText(); - - $value = rand(1, 100); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setOffsetX()); - $this->assertEquals(0, $object->getOffsetX()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setOffsetX($value)); - $this->assertEquals($value, $object->getOffsetX()); - } - - public function testOffsetY() - { - $object = new RichText(); - - $value = rand(1, 100); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setOffsetY()); - $this->assertEquals(0, $object->getOffsetY()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setOffsetY($value)); - $this->assertEquals($value, $object->getOffsetY()); - } - - public function testRotation() - { - $object = new RichText(); - - $value = rand(1, 100); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setRotation()); - $this->assertEquals(0, $object->getRotation()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setRotation($value)); - $this->assertEquals($value, $object->getRotation()); - } - - public function testShadow() - { - $object = new RichText(); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setShadow()); - $this->assertNull($object->getShadow()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setShadow(new Shadow())); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Shadow', $object->getShadow()); - } - - public function testWidth() - { - $object = new RichText(); - - $value = rand(1, 100); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setWidth()); - $this->assertEquals(0, $object->getWidth()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setWidth($value)); - $this->assertEquals($value, $object->getWidth()); - } - - public function testWidthAndHeight() - { - $object = new RichText(); - - $value = rand(1, 100); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setWidthAndHeight()); - $this->assertEquals(0, $object->getWidth()); - $this->assertEquals(0, $object->getHeight()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setWidthAndHeight($value)); - $this->assertEquals($value, $object->getWidth()); - $this->assertEquals(0, $object->getHeight()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setWidthAndHeight($value, $value)); - $this->assertEquals($value, $object->getWidth()); - $this->assertEquals($value, $object->getHeight()); - } -} diff --git a/tests/PhpPowerpoint/Tests/Reader/PowerPoint97Test.php b/tests/PhpPowerpoint/Tests/Reader/PowerPoint97Test.php deleted file mode 100644 index 6edb548f8..000000000 --- a/tests/PhpPowerpoint/Tests/Reader/PowerPoint97Test.php +++ /dev/null @@ -1,139 +0,0 @@ -assertTrue($object->canRead($file)); - } - - - /** - * Test cant read - */ - public function testCantRead() - { - $file = PHPPOWERPOINT_TESTS_BASE_DIR . '/resources/files/serialized.phppt'; - $object = new PowerPoint97(); - - $this->assertFalse($object->canRead($file)); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage Could not open for reading! File does not exist. - */ - public function testLoadFileNotExists() - { - $object = new PowerPoint97(); - $object->load(''); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage Invalid file format for PhpOffice\PhpPowerpoint\Reader\PowerPoint97: - */ - public function testLoadFileBadFormat() - { - $file = PHPPOWERPOINT_TESTS_BASE_DIR . '/resources/files/Sample_01_Simple.pptx'; - $object = new PowerPoint97(); - $object->load($file); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage Could not open for reading! File does not exist. - */ - public function testFileSupportsNotExists() - { - $object = new PowerPoint97(); - $object->fileSupportsUnserializePHPPowerPoint(''); - } - - public function testLoadFile01() - { - $file = PHPPOWERPOINT_TESTS_BASE_DIR . '/resources/files/Sample_00_01.ppt'; - $object = new PowerPoint97(); - $oPHPPowerPoint = $object->load($file); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\PhpPowerpoint', $oPHPPowerPoint); - $this->assertEquals(1, $oPHPPowerPoint->getSlideCount()); - - $oSlide = $oPHPPowerPoint->getSlide(0); - $this->assertCount(2, $oSlide->getShapeCollection()); - } - - public function testLoadFile02() - { - $file = PHPPOWERPOINT_TESTS_BASE_DIR . '/resources/files/Sample_00_02.ppt'; - $object = new PowerPoint97(); - $oPHPPowerPoint = $object->load($file); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\PhpPowerpoint', $oPHPPowerPoint); - $this->assertEquals(4, $oPHPPowerPoint->getSlideCount()); - - $oSlide = $oPHPPowerPoint->getSlide(0); - $this->assertCount(2, $oSlide->getShapeCollection()); - - $oSlide = $oPHPPowerPoint->getSlide(1); - $this->assertCount(3, $oSlide->getShapeCollection()); - - $oSlide = $oPHPPowerPoint->getSlide(2); - $this->assertCount(3, $oSlide->getShapeCollection()); - - $oSlide = $oPHPPowerPoint->getSlide(3); - $this->assertCount(3, $oSlide->getShapeCollection()); - } - - public function testLoadFile03() - { - $file = PHPPOWERPOINT_TESTS_BASE_DIR . '/resources/files/Sample_00_03.ppt'; - $object = new PowerPoint97(); - $oPHPPowerPoint = $object->load($file); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\PhpPowerpoint', $oPHPPowerPoint); - $this->assertEquals(1, $oPHPPowerPoint->getSlideCount()); - - $oSlide = $oPHPPowerPoint->getSlide(0); - $this->assertCount(1, $oSlide->getShapeCollection()); - } - - public function testLoadFile04() - { - $file = PHPPOWERPOINT_TESTS_BASE_DIR . '/resources/files/Sample_00_04.ppt'; - $object = new PowerPoint97(); - $oPHPPowerPoint = $object->load($file); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\PhpPowerpoint', $oPHPPowerPoint); - $this->assertEquals(1, $oPHPPowerPoint->getSlideCount()); - - $oSlide = $oPHPPowerPoint->getSlide(0); - $this->assertCount(4, $oSlide->getShapeCollection()); - } -} diff --git a/tests/PhpPowerpoint/Tests/Shape/Chart/AxisTest.php b/tests/PhpPowerpoint/Tests/Shape/Chart/AxisTest.php deleted file mode 100644 index 03eb335fe..000000000 --- a/tests/PhpPowerpoint/Tests/Shape/Chart/AxisTest.php +++ /dev/null @@ -1,136 +0,0 @@ -assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->getFont()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Border', $object->getBorder()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Fill', $object->getFill()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Alignment', $object->getAlignment()); - } - - public function testAlignment() - { - $object = new Legend(); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Legend', $object->setAlignment(new Alignment())); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Alignment', $object->getAlignment()); - } - - public function testFont() - { - $object = new Legend(); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Legend', $object->setFont()); - $this->assertNull($object->getFont()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Legend', $object->setFont(new Font())); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->getFont()); - } - - public function testHashIndex() - { - $object = new Legend(); - $value = rand(1, 100); - - $this->assertEmpty($object->getHashIndex()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Legend', $object->setHashIndex($value)); - $this->assertEquals($value, $object->getHashIndex()); - } - - public function testHeight() - { - $object = new Legend(); - $value = rand(0, 100); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Legend', $object->setHeight()); - $this->assertEquals(0, $object->getHeight()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Legend', $object->setHeight($value)); - $this->assertEquals($value, $object->getHeight()); - } - - public function testOffsetX() - { - $object = new Legend(); - $value = rand(0, 100); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Legend', $object->setOffsetX()); - $this->assertEquals(0, $object->getOffsetX()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Legend', $object->setOffsetX($value)); - $this->assertEquals($value, $object->getOffsetX()); - } - - public function testOffsetY() - { - $object = new Legend(); - $value = rand(0, 100); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Legend', $object->setOffsetY()); - $this->assertEquals(0, $object->getOffsetY()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Legend', $object->setOffsetY($value)); - $this->assertEquals($value, $object->getOffsetY()); - } - - public function testPosition() - { - $object = new Legend(); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Legend', $object->setPosition()); - $this->assertEquals(Legend::POSITION_RIGHT, $object->getPosition()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Legend', $object->setPosition(Legend::POSITION_BOTTOM)); - $this->assertEquals(Legend::POSITION_BOTTOM, $object->getPosition()); - } - - public function testVisible() - { - $object = new Legend(); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Legend', $object->setVisible()); - $this->assertTrue($object->isVisible()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Legend', $object->setVisible(true)); - $this->assertTrue($object->isVisible()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Legend', $object->setVisible(false)); - $this->assertFalse($object->isVisible()); - } - - public function testWidth() - { - $object = new Legend(); - $value = rand(0, 100); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Legend', $object->setWidth()); - $this->assertEquals(0, $object->getWidth()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Legend', $object->setWidth($value)); - $this->assertEquals($value, $object->getWidth()); - } -} diff --git a/tests/PhpPowerpoint/Tests/Shape/Chart/PlotAreaTest.php b/tests/PhpPowerpoint/Tests/Shape/Chart/PlotAreaTest.php deleted file mode 100644 index 39a2cc0e5..000000000 --- a/tests/PhpPowerpoint/Tests/Shape/Chart/PlotAreaTest.php +++ /dev/null @@ -1,111 +0,0 @@ -assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Axis', $object->getAxisX()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Axis', $object->getAxisY()); - } - - public function testHashIndex() - { - $object = new PlotArea(); - $value = rand(1, 100); - - $this->assertEmpty($object->getHashIndex()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\PlotArea', $object->setHashIndex($value)); - $this->assertEquals($value, $object->getHashIndex()); - } - - public function testHeight() - { - $object = new PlotArea(); - $value = rand(0, 100); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\PlotArea', $object->setHeight()); - $this->assertEquals(0, $object->getHeight()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\PlotArea', $object->setHeight($value)); - $this->assertEquals($value, $object->getHeight()); - } - - public function testOffsetX() - { - $object = new PlotArea(); - $value = rand(0, 100); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\PlotArea', $object->setOffsetX()); - $this->assertEquals(0, $object->getOffsetX()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\PlotArea', $object->setOffsetX($value)); - $this->assertEquals($value, $object->getOffsetX()); - } - - public function testOffsetY() - { - $object = new PlotArea(); - $value = rand(0, 100); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\PlotArea', $object->setOffsetY()); - $this->assertEquals(0, $object->getOffsetY()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\PlotArea', $object->setOffsetY($value)); - $this->assertEquals($value, $object->getOffsetY()); - } - - public function testType() - { - $object = new PlotArea(); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\PlotArea', $object->setType(new Bar3D())); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\AbstractType', $object->getType()); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage Chart type has not been set. - */ - public function testTypeException() - { - $object = new PlotArea(); - $object->getType(); - } - - public function testWidth() - { - $object = new PlotArea(); - $value = rand(0, 100); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\PlotArea', $object->setWidth()); - $this->assertEquals(0, $object->getWidth()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\PlotArea', $object->setWidth($value)); - $this->assertEquals($value, $object->getWidth()); - } -} diff --git a/tests/PhpPowerpoint/Tests/Shape/Chart/TitleTest.php b/tests/PhpPowerpoint/Tests/Shape/Chart/TitleTest.php deleted file mode 100644 index 12a1eede9..000000000 --- a/tests/PhpPowerpoint/Tests/Shape/Chart/TitleTest.php +++ /dev/null @@ -1,134 +0,0 @@ -assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Alignment', $object->getAlignment()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->getFont()); - $this->assertEquals('Calibri', $object->getFont()->getName()); - $this->assertEquals(18, $object->getFont()->getSize()); - } - - public function testAlignment() - { - $object = new Title(); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Title', $object->setAlignment(new Alignment())); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Alignment', $object->getAlignment()); - } - - public function testFont() - { - $object = new Title(); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Title', $object->setFont()); - $this->assertNull($object->getFont()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Title', $object->setFont(new Font())); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->getFont()); - } - - public function testHashIndex() - { - $object = new Title(); - $value = rand(1, 100); - - $this->assertEmpty($object->getHashIndex()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Title', $object->setHashIndex($value)); - $this->assertEquals($value, $object->getHashIndex()); - } - - public function testHeight() - { - $object = new Title(); - $value = rand(0, 100); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Title', $object->setHeight()); - $this->assertEquals(0, $object->getHeight()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Title', $object->setHeight($value)); - $this->assertEquals($value, $object->getHeight()); - } - - public function testOffsetX() - { - $object = new Title(); - $value = rand(0, 100); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Title', $object->setOffsetX()); - $this->assertEquals(0.01, $object->getOffsetX()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Title', $object->setOffsetX($value)); - $this->assertEquals($value, $object->getOffsetX()); - } - - public function testOffsetY() - { - $object = new Title(); - $value = rand(0, 100); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Title', $object->setOffsetY()); - $this->assertEquals(0.01, $object->getOffsetY()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Title', $object->setOffsetY($value)); - $this->assertEquals($value, $object->getOffsetY()); - } - - public function testText() - { - $object = new Title(); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Title', $object->setText()); - $this->assertNull($object->getText()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Title', $object->setText('AAAA')); - $this->assertEquals('AAAA', $object->getText()); - } - - public function testVisible() - { - $object = new Title(); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Title', $object->setVisible()); - $this->assertTrue($object->isVisible()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Title', $object->setVisible(true)); - $this->assertTrue($object->isVisible()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Title', $object->setVisible(false)); - $this->assertFalse($object->isVisible()); - } - - public function testWidth() - { - $object = new Title(); - $value = rand(0, 100); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Title', $object->setWidth()); - $this->assertEquals(0, $object->getWidth()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Title', $object->setWidth($value)); - $this->assertEquals($value, $object->getWidth()); - } -} diff --git a/tests/PhpPowerpoint/Tests/Shape/Chart/View3DTest.php b/tests/PhpPowerpoint/Tests/Shape/Chart/View3DTest.php deleted file mode 100644 index 9368fa7ff..000000000 --- a/tests/PhpPowerpoint/Tests/Shape/Chart/View3DTest.php +++ /dev/null @@ -1,105 +0,0 @@ -assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\View3D', $object->setDepthPercent()); - $this->assertEquals(100, $object->getDepthPercent()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\View3D', $object->setDepthPercent($value)); - $this->assertEquals($value, $object->getDepthPercent()); - } - - public function testHashIndex() - { - $object = new View3D(); - $value = rand(1, 100); - - $this->assertEmpty($object->getHashIndex()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\View3D', $object->setHashIndex($value)); - $this->assertEquals($value, $object->getHashIndex()); - } - - public function testHeightPercent() - { - $object = new View3D(); - $value = rand(5, 500); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\View3D', $object->setHeightPercent()); - $this->assertEquals(100, $object->getHeightPercent()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\View3D', $object->setHeightPercent($value)); - $this->assertEquals($value, $object->getHeightPercent()); - } - - public function testPerspective() - { - $object = new View3D(); - $value = rand(0, 100); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\View3D', $object->setPerspective()); - $this->assertEquals(30, $object->getPerspective()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\View3D', $object->setPerspective($value)); - $this->assertEquals($value, $object->getPerspective()); - } - - public function testRightAngleAxes() - { - $object = new View3D(); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\View3D', $object->setRightAngleAxes()); - $this->assertTrue($object->hasRightAngleAxes()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\View3D', $object->setRightAngleAxes(true)); - $this->assertTrue($object->hasRightAngleAxes()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\View3D', $object->setRightAngleAxes(false)); - $this->assertFalse($object->hasRightAngleAxes()); - } - - public function testRotationX() - { - $object = new View3D(); - $value = rand(-90, 90); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\View3D', $object->setRotationX()); - $this->assertEquals(0, $object->getRotationX()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\View3D', $object->setRotationX($value)); - $this->assertEquals($value, $object->getRotationX()); - } - - public function testRotationY() - { - $object = new View3D(); - $value = rand(-90, 90); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\View3D', $object->setRotationY()); - $this->assertEquals(0, $object->getRotationY()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\View3D', $object->setRotationY($value)); - $this->assertEquals($value, $object->getRotationY()); - } -} diff --git a/tests/PhpPowerpoint/Tests/Shape/ChartTest.php b/tests/PhpPowerpoint/Tests/Shape/ChartTest.php deleted file mode 100644 index fdce9d58b..000000000 --- a/tests/PhpPowerpoint/Tests/Shape/ChartTest.php +++ /dev/null @@ -1,65 +0,0 @@ -assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Title', $object->getTitle()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Legend', $object->getLegend()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\PlotArea', $object->getPlotArea()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\View3D', $object->getView3D()); - } - - - public function testClone() - { - $object = new Chart(); - - $oClone = clone $object; - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart', $oClone); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Title', $oClone->getTitle()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Legend', $oClone->getLegend()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\PlotArea', $oClone->getPlotArea()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\View3D', $oClone->getView3D()); - } - - public function testIncludeSpreadsheet() - { - $object = new Chart(); - - $this->assertFalse($object->hasIncludedSpreadsheet()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart', $object->setIncludeSpreadsheet()); - $this->assertFalse($object->hasIncludedSpreadsheet()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart', $object->setIncludeSpreadsheet(false)); - $this->assertFalse($object->hasIncludedSpreadsheet()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart', $object->setIncludeSpreadsheet(true)); - $this->assertTrue($object->hasIncludedSpreadsheet()); - } -} diff --git a/tests/PhpPowerpoint/Tests/Shape/RichText/ParagraphTest.php b/tests/PhpPowerpoint/Tests/Shape/RichText/ParagraphTest.php deleted file mode 100644 index db05d45b4..000000000 --- a/tests/PhpPowerpoint/Tests/Shape/RichText/ParagraphTest.php +++ /dev/null @@ -1,151 +0,0 @@ -assertEmpty($object->getRichTextElements()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Alignment', $object->getAlignment()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->getFont()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Bullet', $object->getBulletStyle()); - } - - public function testAlignment() - { - $object = new Paragraph(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Alignment', $object->getAlignment()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\Paragraph', $object->setAlignment(new Alignment())); - } - - /** - * Test get/set bullet style - */ - public function testBulletStyle() - { - $object = new Paragraph(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Bullet', $object->getBulletStyle()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\Paragraph', $object->setBulletStyle()); - $this->assertNull($object->getBulletStyle()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\Paragraph', $object->setBulletStyle(new Bullet())); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Bullet', $object->getBulletStyle()); - } - - /** - * Test get/set font - */ - public function testFont() - { - $object = new Paragraph(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->getFont()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\Paragraph', $object->setFont()); - $this->assertNull($object->getFont()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\Paragraph', $object->setFont(new Font())); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->getFont()); - } - - /** - * Test get/set hashCode - */ - public function testHashCode() - { - $object = new Paragraph(); - $oElement = new TextElement(); - $object->addText($oElement); - $this->assertEquals(md5($oElement->getHashCode().$object->getFont()->getHashCode().get_class($object)), $object->getHashCode()); - } - - /** - * Test get/set hashIndex - */ - public function testHashIndex() - { - $object = new Paragraph(); - $value = rand(1, 100); - $object->setHashIndex($value); - $this->assertEquals($value, $object->getHashIndex()); - } - - /** - * Test get/set richTextElements - */ - public function testRichTextElements() - { - $object = new Paragraph(); - $this->assertInternalType('array', $object->getRichTextElements()); - $this->assertEmpty($object->getRichTextElements()); - $object->createBreak(); - $this->assertCount(1, $object->getRichTextElements()); - - $array = array( - new TextElement(), - new TextElement(), - new TextElement(), - ); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\Paragraph', $object->setRichTextElements($array)); - $this->assertCount(3, $object->getRichTextElements()); - } - - /** - * @expectedException \Exception - * expectedExceptionMessage Invalid \PhpOffice\PhpPowerpoint\Shape\RichText\TextElementInterface[] array passed. - */ - public function testRichTextElementsException() - { - $object = new Paragraph(); - $object->setRichTextElements(1); - } - - /** - * Test text methods - */ - public function testText() - { - $object = new Paragraph(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\Paragraph', $object->addText(new TextElement())); - $this->assertcount(1, $object->getRichTextElements()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\TextElement', $object->createText()); - $this->assertcount(2, $object->getRichTextElements()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\TextElement', $object->createText('AAA')); - $this->assertcount(3, $object->getRichTextElements()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\BreakElement', $object->createBreak()); - $this->assertcount(4, $object->getRichTextElements()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\Run', $object->createTextRun()); - $this->assertcount(5, $object->getRichTextElements()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\Run', $object->createTextRun('BBB')); - $this->assertcount(6, $object->getRichTextElements()); - $this->assertEquals('AAA'."\r\n".'BBB', $object->getPlainText()); - $this->assertEquals('AAA'."\r\n".'BBB', (string) $object); - } -} diff --git a/tests/PhpPowerpoint/Tests/Slide/IteratorTest.php b/tests/PhpPowerpoint/Tests/Slide/IteratorTest.php deleted file mode 100644 index f63c1676a..000000000 --- a/tests/PhpPowerpoint/Tests/Slide/IteratorTest.php +++ /dev/null @@ -1,51 +0,0 @@ -addSlide(new Slide()); - - $object = new Iterator($oPHPPowerPoint); - - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide', $object->current()); - $this->assertEquals(0, $object->key()); - $this->assertNull($object->next()); - $this->assertEquals(1, $object->key()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide', $object->current()); - $this->assertTrue($object->valid()); - $this->assertNull($object->next()); - $this->assertFalse($object->valid()); - $this->assertNull($object->rewind()); - $this->assertEquals(0, $object->key()); - } -} diff --git a/tests/PhpPowerpoint/Tests/Writer/ODPresentation/DrawingTest.php b/tests/PhpPowerpoint/Tests/Writer/ODPresentation/DrawingTest.php deleted file mode 100644 index 67065889a..000000000 --- a/tests/PhpPowerpoint/Tests/Writer/ODPresentation/DrawingTest.php +++ /dev/null @@ -1,55 +0,0 @@ -getActiveSlide(); - $oGroup = $oSlide->createGroup(); - - $oDrawing = new Drawing(); - $this->assertInternalType('array', $oDrawing->allDrawings($oPhpPowerPoint)); - $this->assertEmpty($oDrawing->allDrawings($oPhpPowerPoint)); - - $oGroup->createDrawingShape(); - $oGroup->createDrawingShape(); - $oGroup->createDrawingShape(); - - $this->assertInternalType('array', $oDrawing->allDrawings($oPhpPowerPoint)); - $this->assertCount(3, $oDrawing->allDrawings($oPhpPowerPoint)); - } -} diff --git a/tests/PhpPowerpoint/Tests/Writer/PowerPoint2007/ContenTypesTest.php b/tests/PhpPowerpoint/Tests/Writer/PowerPoint2007/ContenTypesTest.php deleted file mode 100644 index 672fb28a2..000000000 --- a/tests/PhpPowerpoint/Tests/Writer/PowerPoint2007/ContenTypesTest.php +++ /dev/null @@ -1,50 +0,0 @@ -setParentWriter(new ODPresentation()); - $oContentTypes->writeContentTypes(new PhpPowerpoint()); - } -} diff --git a/tests/PhpPowerpoint/Tests/Writer/PowerPoint2007/DrawingTest.php b/tests/PhpPowerpoint/Tests/Writer/PowerPoint2007/DrawingTest.php deleted file mode 100644 index a85c220d4..000000000 --- a/tests/PhpPowerpoint/Tests/Writer/PowerPoint2007/DrawingTest.php +++ /dev/null @@ -1,55 +0,0 @@ -getActiveSlide(); - $oGroup = $oSlide->createGroup(); - - $oDrawing = new Drawing(); - $this->assertInternalType('array', $oDrawing->allDrawings($oPhpPowerPoint)); - $this->assertEmpty($oDrawing->allDrawings($oPhpPowerPoint)); - - $oGroup->createDrawingShape(); - $oGroup->createDrawingShape(); - $oGroup->createDrawingShape(); - - $this->assertInternalType('array', $oDrawing->allDrawings($oPhpPowerPoint)); - $this->assertCount(3, $oDrawing->allDrawings($oPhpPowerPoint)); - } -} diff --git a/tests/PhpPowerpoint/Tests/Writer/SerializedTest.php b/tests/PhpPowerpoint/Tests/Writer/SerializedTest.php deleted file mode 100644 index 233c086ae..000000000 --- a/tests/PhpPowerpoint/Tests/Writer/SerializedTest.php +++ /dev/null @@ -1,109 +0,0 @@ -assertInstanceOf('PhpOffice\\PhpPowerpoint\\PhpPowerpoint', $object->getPHPPowerPoint()); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage No PHPPowerPoint assigned. - */ - public function testEmptyConstruct() - { - $object = new Serialized(); - $object->getPHPPowerPoint(); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage Filename is empty. - */ - public function testSaveEmpty() - { - $object = new Serialized(new PhpPowerpoint()); - $object->save(''); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage PHPPowerPoint object unassigned. - */ - public function testSaveNoObject() - { - $object = new Serialized(); - $object->save('file.phpppt'); - } - - public function testSave() - { - $oPHPPowerPoint = new PhpPowerpoint(); - $oSlide = $oPHPPowerPoint->getActiveSlide(); - $oImage = $oSlide->createDrawingShape(); - $oImage->setPath(PHPPOWERPOINT_TESTS_BASE_DIR.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'images'.DIRECTORY_SEPARATOR.'PHPPowerPointLogo.png'); - $object = new Serialized($oPHPPowerPoint); - - $file = tempnam(sys_get_temp_dir(), 'PhpPowerpoint_Serialized'); - - $this->assertFileExists($file, $object->save($file)); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage Could not open - */ - public function testSaveNotExistingDir() - { - $oPHPPowerPoint = new PhpPowerpoint(); - $oSlide = $oPHPPowerPoint->getActiveSlide(); - $oImage = $oSlide->createDrawingShape(); - $oImage->setPath(PHPPOWERPOINT_TESTS_BASE_DIR.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'images'.DIRECTORY_SEPARATOR.'PHPPowerPointLogo.png'); - $object = new Serialized($oPHPPowerPoint); - - $file = tempnam(sys_get_temp_dir(), 'PhpPowerpoint_Serialized'); - - $this->assertFileExists($file, $object->save($file.DIRECTORY_SEPARATOR.'test'.DIRECTORY_SEPARATOR.'test')); - } - - public function testSaveOverwriting() - { - $oPHPPowerPoint = new PhpPowerpoint(); - $oSlide = $oPHPPowerPoint->getActiveSlide(); - $oImage = $oSlide->createDrawingShape(); - $oImage->setPath(PHPPOWERPOINT_TESTS_BASE_DIR.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'images'.DIRECTORY_SEPARATOR.'PHPPowerPointLogo.png'); - $object = new Serialized($oPHPPowerPoint); - - $file = tempnam(sys_get_temp_dir(), 'PhpPowerpoint_Serialized'); - file_put_contents($file, rand(1, 100)); - - $this->assertFileExists($file, $object->save($file)); - } -} diff --git a/tests/PhpPresentation/Tests/AbstractShapeTest.php b/tests/PhpPresentation/Tests/AbstractShapeTest.php new file mode 100644 index 000000000..345366d0d --- /dev/null +++ b/tests/PhpPresentation/Tests/AbstractShapeTest.php @@ -0,0 +1,154 @@ +assertEquals(0, $object->getOffsetX()); + $this->assertEquals(0, $object->getOffsetY()); + $this->assertEquals(0, $object->getHeight()); + $this->assertEquals(0, $object->getRotation()); + $this->assertEquals(0, $object->getWidth()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Border', $object->getBorder()); + $this->assertEquals(Border::LINE_NONE, $object->getBorder()->getLineStyle()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Fill', $object->getFill()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Shadow', $object->getShadow()); + } + + public function testFill() + { + $object = new RichText(); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\AbstractShape', $object->setFill()); + $this->assertNull($object->getFill()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\AbstractShape', $object->setFill(new Fill())); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Fill', $object->getFill()); + } + + public function testHeight() + { + $object = new RichText(); + + $value = rand(1, 100); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\AbstractShape', $object->setHeight()); + $this->assertEquals(0, $object->getHeight()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\AbstractShape', $object->setHeight($value)); + $this->assertEquals($value, $object->getHeight()); + } + + public function testHyperlink() + { + $object = new RichText(); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\AbstractShape', $object->setHyperlink()); + $this->assertFalse($object->hasHyperlink()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Hyperlink', $object->getHyperlink()); + $this->assertTrue($object->hasHyperlink()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\AbstractShape', $object->setHyperlink(new Hyperlink('http://www.google.fr'))); + $this->assertTrue($object->hasHyperlink()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Hyperlink', $object->getHyperlink()); + $this->assertTrue($object->hasHyperlink()); + } + + public function testOffsetX() + { + $object = new RichText(); + + $value = rand(1, 100); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\AbstractShape', $object->setOffsetX()); + $this->assertEquals(0, $object->getOffsetX()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\AbstractShape', $object->setOffsetX($value)); + $this->assertEquals($value, $object->getOffsetX()); + } + + public function testOffsetY() + { + $object = new RichText(); + + $value = rand(1, 100); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\AbstractShape', $object->setOffsetY()); + $this->assertEquals(0, $object->getOffsetY()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\AbstractShape', $object->setOffsetY($value)); + $this->assertEquals($value, $object->getOffsetY()); + } + + public function testRotation() + { + $object = new RichText(); + + $value = rand(1, 100); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\AbstractShape', $object->setRotation()); + $this->assertEquals(0, $object->getRotation()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\AbstractShape', $object->setRotation($value)); + $this->assertEquals($value, $object->getRotation()); + } + + public function testShadow() + { + $object = new RichText(); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\AbstractShape', $object->setShadow()); + $this->assertNull($object->getShadow()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\AbstractShape', $object->setShadow(new Shadow())); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Shadow', $object->getShadow()); + } + + public function testWidth() + { + $object = new RichText(); + + $value = rand(1, 100); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\AbstractShape', $object->setWidth()); + $this->assertEquals(0, $object->getWidth()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\AbstractShape', $object->setWidth($value)); + $this->assertEquals($value, $object->getWidth()); + } + + public function testWidthAndHeight() + { + $object = new RichText(); + + $value = rand(1, 100); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\AbstractShape', $object->setWidthAndHeight()); + $this->assertEquals(0, $object->getWidth()); + $this->assertEquals(0, $object->getHeight()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\AbstractShape', $object->setWidthAndHeight($value)); + $this->assertEquals($value, $object->getWidth()); + $this->assertEquals(0, $object->getHeight()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\AbstractShape', $object->setWidthAndHeight($value, $value)); + $this->assertEquals($value, $object->getWidth()); + $this->assertEquals($value, $object->getHeight()); + } +} diff --git a/tests/PhpPowerpoint/Tests/AutoloaderTest.php b/tests/PhpPresentation/Tests/AutoloaderTest.php similarity index 58% rename from tests/PhpPowerpoint/Tests/AutoloaderTest.php rename to tests/PhpPresentation/Tests/AutoloaderTest.php index 583170f25..31fd2c99e 100644 --- a/tests/PhpPowerpoint/Tests/AutoloaderTest.php +++ b/tests/PhpPresentation/Tests/AutoloaderTest.php @@ -1,23 +1,23 @@ assertContains( - array('PhpOffice\\PhpPowerpoint\\Autoloader', 'autoload'), + array('PhpOffice\\PhpPresentation\\Autoloader', 'autoload'), spl_autoload_functions() ); } @@ -47,8 +47,8 @@ public function testAutoload() $this->assertEquals( $declaredCount, count(get_declared_classes()), - 'PhpOffice\\PhpPowerpoint\\Autoloader::autoload() is trying to load ' . - 'classes outside of the PhpOffice\\PhpPowerpoint namespace' + 'PhpOffice\\PhpPresentation\\Autoloader::autoload() is trying to load ' . + 'classes outside of the PhpOffice\\PhpPresentation namespace' ); } } diff --git a/tests/PhpPowerpoint/Tests/DocumentLayoutTest.php b/tests/PhpPresentation/Tests/DocumentLayoutTest.php similarity index 55% rename from tests/PhpPowerpoint/Tests/DocumentLayoutTest.php rename to tests/PhpPresentation/Tests/DocumentLayoutTest.php index f7ddf67bd..bbbc6e86e 100644 --- a/tests/PhpPowerpoint/Tests/DocumentLayoutTest.php +++ b/tests/PhpPresentation/Tests/DocumentLayoutTest.php @@ -1,28 +1,28 @@ assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCX($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\DocumentLayout', $object->setCX($value)); $this->assertEquals($value, $object->getCX()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCX($value, DocumentLayout::UNIT_CENTIMETER)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\DocumentLayout', $object->setCX($value, DocumentLayout::UNIT_CENTIMETER)); $this->assertEquals($value, $object->getCX(DocumentLayout::UNIT_CENTIMETER)); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCX($value, DocumentLayout::UNIT_EMU)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\DocumentLayout', $object->setCX($value, DocumentLayout::UNIT_EMU)); $this->assertEquals($value, $object->getCX(DocumentLayout::UNIT_EMU)); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCX($value, DocumentLayout::UNIT_INCH)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\DocumentLayout', $object->setCX($value, DocumentLayout::UNIT_INCH)); $this->assertEquals($value, $object->getCX(DocumentLayout::UNIT_INCH)); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCX($value, DocumentLayout::UNIT_MILLIMETER)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\DocumentLayout', $object->setCX($value, DocumentLayout::UNIT_MILLIMETER)); $this->assertEquals($value, $object->getCX(DocumentLayout::UNIT_MILLIMETER)); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCX($value, DocumentLayout::UNIT_POINT)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\DocumentLayout', $object->setCX($value, DocumentLayout::UNIT_POINT)); $this->assertEquals($value, $object->getCX(DocumentLayout::UNIT_POINT)); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCX($value, DocumentLayout::UNIT_PIXEL)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\DocumentLayout', $object->setCX($value, DocumentLayout::UNIT_PIXEL)); $this->assertEquals($value, $object->getCX(DocumentLayout::UNIT_PIXEL)); } @@ -78,19 +78,19 @@ public function testCY() { $value = rand(1, 100000); $object = new DocumentLayout(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCY($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\DocumentLayout', $object->setCY($value)); $this->assertEquals($value, $object->getCY()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_CENTIMETER)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_CENTIMETER)); $this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_CENTIMETER)); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_EMU)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_EMU)); $this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_EMU)); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_INCH)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_INCH)); $this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_INCH)); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_MILLIMETER)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_MILLIMETER)); $this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_MILLIMETER)); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_POINT)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_POINT)); $this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_POINT)); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_PIXEL)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_PIXEL)); $this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_PIXEL)); } } diff --git a/tests/PhpPowerpoint/Tests/DocumentPropertiesTest.php b/tests/PhpPresentation/Tests/DocumentPropertiesTest.php similarity index 75% rename from tests/PhpPowerpoint/Tests/DocumentPropertiesTest.php rename to tests/PhpPresentation/Tests/DocumentPropertiesTest.php index 3ff35f96a..34a2db853 100644 --- a/tests/PhpPowerpoint/Tests/DocumentPropertiesTest.php +++ b/tests/PhpPresentation/Tests/DocumentPropertiesTest.php @@ -1,28 +1,28 @@ assertInstanceOf($class, IOFactory::createWriter(new PhpPowerpoint())); + $this->assertInstanceOf($class, IOFactory::createWriter(new PhpPresentation())); } /** @@ -42,7 +42,7 @@ public function testCreateWriter() */ public function testCreateReader() { - $class = 'PhpOffice\\PhpPowerpoint\\Reader\\ReaderInterface'; + $class = 'PhpOffice\\PhpPresentation\\Reader\\ReaderInterface'; $this->assertInstanceOf($class, IOFactory::createReader('Serialized')); } @@ -60,17 +60,17 @@ public function testLoadClassException() public function testLoad() { - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\PhpPowerpoint', IOFactory::load(PHPPOWERPOINT_TESTS_BASE_DIR.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'files'.DIRECTORY_SEPARATOR.'serialized.phppt')); + $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\PhpPowerpoint\Reader\ReaderInterface for file. + * @expectedExceptionMessage Could not automatically determine \PhpOffice\PhpPresentation\Reader\ReaderInterface for file. */ public function testLoadException() { - IOFactory::load(PHPPOWERPOINT_TESTS_BASE_DIR.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'images'.DIRECTORY_SEPARATOR.'PHPPowerPointLogo.png'); + IOFactory::load(PHPPRESENTATION_TESTS_BASE_DIR.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'images'.DIRECTORY_SEPARATOR.'PhpPresentationLogo.png'); } } diff --git a/tests/PhpPowerpoint/Tests/PhpPowerpointTest.php b/tests/PhpPresentation/Tests/PhpPowerpointTest.php similarity index 61% rename from tests/PhpPowerpoint/Tests/PhpPowerpointTest.php rename to tests/PhpPresentation/Tests/PhpPowerpointTest.php index a95b7f500..228e58d47 100644 --- a/tests/PhpPowerpoint/Tests/PhpPowerpointTest.php +++ b/tests/PhpPresentation/Tests/PhpPowerpointTest.php @@ -1,49 +1,49 @@ getSlide(); $this->assertEquals(new DocumentProperties(), $object->getProperties()); $this->assertEquals(new DocumentLayout(), $object->getLayout()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide', $object->getSlide()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide', $object->getSlide()); $this->assertEquals(1, count($object->getAllSlides())); $this->assertEquals(0, $object->getIndex($slide)); $this->assertEquals(1, $object->getSlideCount()); $this->assertEquals(0, $object->getActiveSlideIndex()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide\\Iterator', $object->getSlideIterator()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\Iterator', $object->getSlideIterator()); } /** @@ -51,9 +51,9 @@ public function testConstruct() */ public function testAddExternalSlide() { - $origin = new PhpPowerpoint(); + $origin = new PhpPresentation(); $slide = $origin->getSlide(); - $object = new PhpPowerpoint(); + $object = new PhpPresentation(); $object->addExternalSlide($slide); $this->assertEquals(2, $object->getSlideCount()); @@ -64,8 +64,8 @@ public function testAddExternalSlide() */ public function testCopy() { - $object = new PhpPowerpoint(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\PhpPowerpoint', $object->copy()); + $object = new PhpPresentation(); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $object->copy()); } /** @@ -76,7 +76,7 @@ public function testCopy() */ public function testRemoveSlideByIndexException() { - $object = new PhpPowerpoint(); + $object = new PhpPresentation(); $object->removeSlideByIndex(1); } @@ -88,7 +88,7 @@ public function testRemoveSlideByIndexException() */ public function testGetSlideException() { - $object = new PhpPowerpoint(); + $object = new PhpPresentation(); $object->getSlide(1); } @@ -100,7 +100,7 @@ public function testGetSlideException() */ public function testSetActiveSlideIndexException() { - $object = new PhpPowerpoint(); + $object = new PhpPresentation(); $object->setActiveSlideIndex(1); } } diff --git a/tests/PhpPresentation/Tests/Reader/PowerPoint97Test.php b/tests/PhpPresentation/Tests/Reader/PowerPoint97Test.php new file mode 100644 index 000000000..12aa1a6c1 --- /dev/null +++ b/tests/PhpPresentation/Tests/Reader/PowerPoint97Test.php @@ -0,0 +1,139 @@ +assertTrue($object->canRead($file)); + } + + + /** + * Test cant read + */ + public function testCantRead() + { + $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/serialized.phppt'; + $object = new PowerPoint97(); + + $this->assertFalse($object->canRead($file)); + } + + /** + * @expectedException \Exception + * @expectedExceptionMessage Could not open for reading! File does not exist. + */ + public function testLoadFileNotExists() + { + $object = new PowerPoint97(); + $object->load(''); + } + + /** + * @expectedException \Exception + * @expectedExceptionMessage Invalid file format for PhpOffice\PhpPresentation\Reader\PowerPoint97: + */ + public function testLoadFileBadFormat() + { + $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_01_Simple.pptx'; + $object = new PowerPoint97(); + $object->load($file); + } + + /** + * @expectedException \Exception + * @expectedExceptionMessage Could not open for reading! File does not exist. + */ + public function testFileSupportsNotExists() + { + $object = new PowerPoint97(); + $object->fileSupportsUnserializePhpPresentation(''); + } + + public function testLoadFile01() + { + $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_00_01.ppt'; + $object = new PowerPoint97(); + $oPhpPresentation = $object->load($file); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $oPhpPresentation); + $this->assertEquals(1, $oPhpPresentation->getSlideCount()); + + $oSlide = $oPhpPresentation->getSlide(0); + $this->assertCount(2, $oSlide->getShapeCollection()); + } + + public function testLoadFile02() + { + $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_00_02.ppt'; + $object = new PowerPoint97(); + $oPhpPresentation = $object->load($file); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $oPhpPresentation); + $this->assertEquals(4, $oPhpPresentation->getSlideCount()); + + $oSlide = $oPhpPresentation->getSlide(0); + $this->assertCount(2, $oSlide->getShapeCollection()); + + $oSlide = $oPhpPresentation->getSlide(1); + $this->assertCount(3, $oSlide->getShapeCollection()); + + $oSlide = $oPhpPresentation->getSlide(2); + $this->assertCount(3, $oSlide->getShapeCollection()); + + $oSlide = $oPhpPresentation->getSlide(3); + $this->assertCount(3, $oSlide->getShapeCollection()); + } + + public function testLoadFile03() + { + $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_00_03.ppt'; + $object = new PowerPoint97(); + $oPhpPresentation = $object->load($file); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $oPhpPresentation); + $this->assertEquals(1, $oPhpPresentation->getSlideCount()); + + $oSlide = $oPhpPresentation->getSlide(0); + $this->assertCount(1, $oSlide->getShapeCollection()); + } + + public function testLoadFile04() + { + $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_00_04.ppt'; + $object = new PowerPoint97(); + $oPhpPresentation = $object->load($file); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $oPhpPresentation); + $this->assertEquals(1, $oPhpPresentation->getSlideCount()); + + $oSlide = $oPhpPresentation->getSlide(0); + $this->assertCount(4, $oSlide->getShapeCollection()); + } +} diff --git a/tests/PhpPowerpoint/Tests/Reader/SerializedTest.php b/tests/PhpPresentation/Tests/Reader/SerializedTest.php similarity index 63% rename from tests/PhpPowerpoint/Tests/Reader/SerializedTest.php rename to tests/PhpPresentation/Tests/Reader/SerializedTest.php index ae218b2c4..6f7bbfddd 100644 --- a/tests/PhpPowerpoint/Tests/Reader/SerializedTest.php +++ b/tests/PhpPresentation/Tests/Reader/SerializedTest.php @@ -1,28 +1,28 @@ assertTrue($object->canRead($file)); @@ -49,11 +49,11 @@ public function testLoadFileNotExists() /** * @expectedException \Exception - * @expectedExceptionMessage Invalid file format for PhpOffice\PhpPowerpoint\Reader\Serialized: + * @expectedExceptionMessage Invalid file format for PhpOffice\PhpPresentation\Reader\Serialized: */ public function testLoadFileBadFormat() { - $file = PHPPOWERPOINT_TESTS_BASE_DIR . '/resources/files/Sample_01_Simple.pptx'; + $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_01_Simple.pptx'; $object = new Serialized(); $object->load($file); } @@ -65,15 +65,15 @@ public function testLoadFileBadFormat() public function testFileSupportsNotExists() { $object = new Serialized(); - $object->fileSupportsUnserializePHPPowerPoint(''); + $object->fileSupportsUnserializePhpPresentation(''); } public function testLoadSerializedFileNotExists() { - $file = tempnam(sys_get_temp_dir(), 'PhpPowerpoint_Serialized'); + $file = tempnam(sys_get_temp_dir(), 'PhpPresentation_Serialized'); $oArchive = new \ZipArchive(); $oArchive->open($file, \ZipArchive::CREATE); - $oArchive->addFromString('PHPPowerPoint.xml', ''); + $oArchive->addFromString('PhpPresentation.xml', ''); $oArchive->close(); $object = new Serialized(); diff --git a/tests/PhpPresentation/Tests/Shape/Chart/AxisTest.php b/tests/PhpPresentation/Tests/Shape/Chart/AxisTest.php new file mode 100644 index 000000000..416450149 --- /dev/null +++ b/tests/PhpPresentation/Tests/Shape/Chart/AxisTest.php @@ -0,0 +1,136 @@ +assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->getFont()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Border', $object->getBorder()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Fill', $object->getFill()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->getAlignment()); + } + + public function testAlignment() + { + $object = new Legend(); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Legend', $object->setAlignment(new Alignment())); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->getAlignment()); + } + + public function testFont() + { + $object = new Legend(); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Legend', $object->setFont()); + $this->assertNull($object->getFont()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Legend', $object->setFont(new Font())); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->getFont()); + } + + public function testHashIndex() + { + $object = new Legend(); + $value = rand(1, 100); + + $this->assertEmpty($object->getHashIndex()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Legend', $object->setHashIndex($value)); + $this->assertEquals($value, $object->getHashIndex()); + } + + public function testHeight() + { + $object = new Legend(); + $value = rand(0, 100); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Legend', $object->setHeight()); + $this->assertEquals(0, $object->getHeight()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Legend', $object->setHeight($value)); + $this->assertEquals($value, $object->getHeight()); + } + + public function testOffsetX() + { + $object = new Legend(); + $value = rand(0, 100); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Legend', $object->setOffsetX()); + $this->assertEquals(0, $object->getOffsetX()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Legend', $object->setOffsetX($value)); + $this->assertEquals($value, $object->getOffsetX()); + } + + public function testOffsetY() + { + $object = new Legend(); + $value = rand(0, 100); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Legend', $object->setOffsetY()); + $this->assertEquals(0, $object->getOffsetY()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Legend', $object->setOffsetY($value)); + $this->assertEquals($value, $object->getOffsetY()); + } + + public function testPosition() + { + $object = new Legend(); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Legend', $object->setPosition()); + $this->assertEquals(Legend::POSITION_RIGHT, $object->getPosition()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Legend', $object->setPosition(Legend::POSITION_BOTTOM)); + $this->assertEquals(Legend::POSITION_BOTTOM, $object->getPosition()); + } + + public function testVisible() + { + $object = new Legend(); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Legend', $object->setVisible()); + $this->assertTrue($object->isVisible()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Legend', $object->setVisible(true)); + $this->assertTrue($object->isVisible()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Legend', $object->setVisible(false)); + $this->assertFalse($object->isVisible()); + } + + public function testWidth() + { + $object = new Legend(); + $value = rand(0, 100); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Legend', $object->setWidth()); + $this->assertEquals(0, $object->getWidth()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Legend', $object->setWidth($value)); + $this->assertEquals($value, $object->getWidth()); + } +} diff --git a/tests/PhpPowerpoint/Tests/Shape/Chart/LegendTest.php b/tests/PhpPresentation/Tests/Shape/Chart/LegendTest.php similarity index 55% rename from tests/PhpPowerpoint/Tests/Shape/Chart/LegendTest.php rename to tests/PhpPresentation/Tests/Shape/Chart/LegendTest.php index 0c62436c7..9ee1858b0 100644 --- a/tests/PhpPowerpoint/Tests/Shape/Chart/LegendTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/LegendTest.php @@ -1,28 +1,28 @@ assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Axis', $object->setFormatCode()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Axis', $object->setFormatCode()); $this->assertEquals('', $object->getFormatCode()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Axis', $object->setFormatCode('AAAA')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Axis', $object->setFormatCode('AAAA')); $this->assertEquals('AAAA', $object->getFormatCode()); } @@ -48,7 +48,7 @@ public function testHashIndex() $value = rand(1, 100); $this->assertEmpty($object->getHashIndex()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Axis', $object->setHashIndex($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Axis', $object->setHashIndex($value)); $this->assertEquals($value, $object->getHashIndex()); } @@ -56,7 +56,7 @@ public function testTitle() { $object = new Axis(); $this->assertEquals('Axis Title', $object->getTitle()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Axis', $object->setTitle('AAAA')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Axis', $object->setTitle('AAAA')); $this->assertEquals('AAAA', $object->getTitle()); } } diff --git a/tests/PhpPresentation/Tests/Shape/Chart/PlotAreaTest.php b/tests/PhpPresentation/Tests/Shape/Chart/PlotAreaTest.php new file mode 100644 index 000000000..7a0c2fd2d --- /dev/null +++ b/tests/PhpPresentation/Tests/Shape/Chart/PlotAreaTest.php @@ -0,0 +1,111 @@ +assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Axis', $object->getAxisX()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Axis', $object->getAxisY()); + } + + public function testHashIndex() + { + $object = new PlotArea(); + $value = rand(1, 100); + + $this->assertEmpty($object->getHashIndex()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\PlotArea', $object->setHashIndex($value)); + $this->assertEquals($value, $object->getHashIndex()); + } + + public function testHeight() + { + $object = new PlotArea(); + $value = rand(0, 100); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\PlotArea', $object->setHeight()); + $this->assertEquals(0, $object->getHeight()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\PlotArea', $object->setHeight($value)); + $this->assertEquals($value, $object->getHeight()); + } + + public function testOffsetX() + { + $object = new PlotArea(); + $value = rand(0, 100); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\PlotArea', $object->setOffsetX()); + $this->assertEquals(0, $object->getOffsetX()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\PlotArea', $object->setOffsetX($value)); + $this->assertEquals($value, $object->getOffsetX()); + } + + public function testOffsetY() + { + $object = new PlotArea(); + $value = rand(0, 100); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\PlotArea', $object->setOffsetY()); + $this->assertEquals(0, $object->getOffsetY()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\PlotArea', $object->setOffsetY($value)); + $this->assertEquals($value, $object->getOffsetY()); + } + + public function testType() + { + $object = new PlotArea(); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\PlotArea', $object->setType(new Bar3D())); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\AbstractType', $object->getType()); + } + + /** + * @expectedException \Exception + * @expectedExceptionMessage Chart type has not been set. + */ + public function testTypeException() + { + $object = new PlotArea(); + $object->getType(); + } + + public function testWidth() + { + $object = new PlotArea(); + $value = rand(0, 100); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\PlotArea', $object->setWidth()); + $this->assertEquals(0, $object->getWidth()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\PlotArea', $object->setWidth($value)); + $this->assertEquals($value, $object->getWidth()); + } +} diff --git a/tests/PhpPowerpoint/Tests/Shape/Chart/SeriesTest.php b/tests/PhpPresentation/Tests/Shape/Chart/SeriesTest.php similarity index 53% rename from tests/PhpPowerpoint/Tests/Shape/Chart/SeriesTest.php rename to tests/PhpPresentation/Tests/Shape/Chart/SeriesTest.php index 93e3c8272..a5f440437 100644 --- a/tests/PhpPowerpoint/Tests/Shape/Chart/SeriesTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/SeriesTest.php @@ -1,30 +1,30 @@ assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Fill', $object->getFill()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->getFont()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Fill', $object->getFill()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->getFont()); $this->assertEquals('Calibri', $object->getFont()->getName()); $this->assertEquals(9, $object->getFont()->getSize()); $this->assertEquals('Series Title', $object->getTitle()); @@ -48,12 +48,12 @@ public function testDataLabelNumFormat() $this->assertEmpty($object->getDlblNumFormat()); $this->assertFalse($object->hasDlblNumFormat()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Series', $object->setDlblNumFormat('#%')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Series', $object->setDlblNumFormat('#%')); $this->assertEquals('#%', $object->getDlblNumFormat()); $this->assertTrue($object->hasDlblNumFormat()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Series', $object->setDlblNumFormat()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Series', $object->setDlblNumFormat()); $this->assertEmpty($object->getDlblNumFormat()); $this->assertFalse($object->hasDlblNumFormat()); @@ -66,27 +66,27 @@ public function testDataPointFills() $this->assertInternalType('array', $object->getDataPointFills()); $this->assertEmpty($object->getDataPointFills()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Fill', $object->getDataPointFill(0)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Fill', $object->getDataPointFill(0)); } public function testFill() { $object = new Series(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Series', $object->setFill()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Series', $object->setFill()); $this->assertNull($object->getFill()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Series', $object->setFill(new Fill())); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Fill', $object->getFill()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Series', $object->setFill(new Fill())); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Fill', $object->getFill()); } public function testFont() { $object = new Series(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Series', $object->setFont()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Series', $object->setFont()); $this->assertNull($object->getFont()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Series', $object->setFont(new Font())); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->getFont()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Series', $object->setFont(new Font())); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->getFont()); } public function testHashIndex() @@ -95,7 +95,7 @@ public function testHashIndex() $value = rand(1, 100); $this->assertEmpty($object->getHashIndex()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Series', $object->setHashIndex($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Series', $object->setHashIndex($value)); $this->assertEquals($value, $object->getHashIndex()); } @@ -111,7 +111,7 @@ public function testLabelPosition() $object = new Series(); $this->assertEmpty($object->getHashIndex()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Series', $object->setLabelPosition(Series::LABEL_INSIDEBASE)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Series', $object->setLabelPosition(Series::LABEL_INSIDEBASE)); $this->assertEquals(Series::LABEL_INSIDEBASE, $object->getLabelPosition()); } @@ -119,9 +119,9 @@ public function testShowCategoryName() { $object = new Series(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Series', $object->setShowCategoryName(true)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Series', $object->setShowCategoryName(true)); $this->assertTrue($object->hasShowCategoryName()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Series', $object->setShowCategoryName(false)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Series', $object->setShowCategoryName(false)); $this->assertFalse($object->hasShowCategoryName()); } @@ -129,9 +129,9 @@ public function testShowLeaderLines() { $object = new Series(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Series', $object->setShowLeaderLines(true)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Series', $object->setShowLeaderLines(true)); $this->assertTrue($object->hasShowLeaderLines()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Series', $object->setShowLeaderLines(false)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Series', $object->setShowLeaderLines(false)); $this->assertFalse($object->hasShowLeaderLines()); } @@ -139,9 +139,9 @@ public function testShowPercentage() { $object = new Series(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Series', $object->setShowPercentage(true)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Series', $object->setShowPercentage(true)); $this->assertTrue($object->hasShowPercentage()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Series', $object->setShowPercentage(false)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Series', $object->setShowPercentage(false)); $this->assertFalse($object->hasShowPercentage()); } @@ -149,9 +149,9 @@ public function testShowSeriesName() { $object = new Series(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Series', $object->setShowSeriesName(true)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Series', $object->setShowSeriesName(true)); $this->assertTrue($object->hasShowSeriesName()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Series', $object->setShowSeriesName(false)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Series', $object->setShowSeriesName(false)); $this->assertFalse($object->hasShowSeriesName()); } @@ -159,9 +159,9 @@ public function testShowValue() { $object = new Series(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Series', $object->setShowValue(true)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Series', $object->setShowValue(true)); $this->assertTrue($object->hasShowValue()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Series', $object->setShowValue(false)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Series', $object->setShowValue(false)); $this->assertFalse($object->hasShowValue()); } @@ -169,9 +169,9 @@ public function testTitle() { $object = new Series(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Series', $object->setTitle()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Series', $object->setTitle()); $this->assertEquals('Series Title', $object->getTitle()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Series', $object->setTitle('AAAA')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Series', $object->setTitle('AAAA')); $this->assertEquals('AAAA', $object->getTitle()); } @@ -188,11 +188,11 @@ public function testValue() $this->assertInternalType('array', $object->getValues()); $this->assertEmpty($object->getValues()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Series', $object->setValues()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Series', $object->setValues()); $this->assertEmpty($object->getValues()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Series', $object->setValues($array)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Series', $object->setValues($array)); $this->assertCount(count($array), $object->getValues()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Series', $object->addValue(4, 'e')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Series', $object->addValue(4, 'e')); $this->assertCount(count($array) + 1, $object->getValues()); } } diff --git a/tests/PhpPresentation/Tests/Shape/Chart/TitleTest.php b/tests/PhpPresentation/Tests/Shape/Chart/TitleTest.php new file mode 100644 index 000000000..a2ba66f9e --- /dev/null +++ b/tests/PhpPresentation/Tests/Shape/Chart/TitleTest.php @@ -0,0 +1,134 @@ +assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->getAlignment()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->getFont()); + $this->assertEquals('Calibri', $object->getFont()->getName()); + $this->assertEquals(18, $object->getFont()->getSize()); + } + + public function testAlignment() + { + $object = new Title(); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Title', $object->setAlignment(new Alignment())); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->getAlignment()); + } + + public function testFont() + { + $object = new Title(); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Title', $object->setFont()); + $this->assertNull($object->getFont()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Title', $object->setFont(new Font())); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->getFont()); + } + + public function testHashIndex() + { + $object = new Title(); + $value = rand(1, 100); + + $this->assertEmpty($object->getHashIndex()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Title', $object->setHashIndex($value)); + $this->assertEquals($value, $object->getHashIndex()); + } + + public function testHeight() + { + $object = new Title(); + $value = rand(0, 100); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Title', $object->setHeight()); + $this->assertEquals(0, $object->getHeight()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Title', $object->setHeight($value)); + $this->assertEquals($value, $object->getHeight()); + } + + public function testOffsetX() + { + $object = new Title(); + $value = rand(0, 100); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Title', $object->setOffsetX()); + $this->assertEquals(0.01, $object->getOffsetX()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Title', $object->setOffsetX($value)); + $this->assertEquals($value, $object->getOffsetX()); + } + + public function testOffsetY() + { + $object = new Title(); + $value = rand(0, 100); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Title', $object->setOffsetY()); + $this->assertEquals(0.01, $object->getOffsetY()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Title', $object->setOffsetY($value)); + $this->assertEquals($value, $object->getOffsetY()); + } + + public function testText() + { + $object = new Title(); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Title', $object->setText()); + $this->assertNull($object->getText()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Title', $object->setText('AAAA')); + $this->assertEquals('AAAA', $object->getText()); + } + + public function testVisible() + { + $object = new Title(); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Title', $object->setVisible()); + $this->assertTrue($object->isVisible()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Title', $object->setVisible(true)); + $this->assertTrue($object->isVisible()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Title', $object->setVisible(false)); + $this->assertFalse($object->isVisible()); + } + + public function testWidth() + { + $object = new Title(); + $value = rand(0, 100); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Title', $object->setWidth()); + $this->assertEquals(0, $object->getWidth()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Title', $object->setWidth($value)); + $this->assertEquals($value, $object->getWidth()); + } +} diff --git a/tests/PhpPowerpoint/Tests/Shape/Chart/Type/AbstractTest.php b/tests/PhpPresentation/Tests/Shape/Chart/Type/AbstractTest.php similarity index 55% rename from tests/PhpPowerpoint/Tests/Shape/Chart/Type/AbstractTest.php rename to tests/PhpPresentation/Tests/Shape/Chart/Type/AbstractTest.php index 636ee96ce..cc4644d40 100644 --- a/tests/PhpPowerpoint/Tests/Shape/Chart/Type/AbstractTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/Type/AbstractTest.php @@ -1,28 +1,28 @@ assertEmpty($object->getHashIndex()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Scatter', $object->setHashIndex($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Scatter', $object->setHashIndex($value)); $this->assertEquals($value, $object->getHashIndex()); } } diff --git a/tests/PhpPowerpoint/Tests/Shape/Chart/Type/AreaTest.php b/tests/PhpPresentation/Tests/Shape/Chart/Type/AreaTest.php similarity index 56% rename from tests/PhpPowerpoint/Tests/Shape/Chart/Type/AreaTest.php rename to tests/PhpPresentation/Tests/Shape/Chart/Type/AreaTest.php index db338b273..c1766c141 100644 --- a/tests/PhpPowerpoint/Tests/Shape/Chart/Type/AreaTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/Type/AreaTest.php @@ -1,29 +1,29 @@ assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Area', $object->setData()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Area', $object->setData()); $this->assertEmpty($object->getData()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Area', $object->setData($array)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Area', $object->setData($array)); $this->assertCount(count($array), $object->getData()); } @@ -49,7 +49,7 @@ public function testSeries() { $object = new Area(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Area', $object->addSeries(new Series())); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Area', $object->addSeries(new Series())); $this->assertCount(1, $object->getData()); } diff --git a/tests/PhpPowerpoint/Tests/Shape/Chart/Type/Bar3DTest.php b/tests/PhpPresentation/Tests/Shape/Chart/Type/Bar3DTest.php similarity index 54% rename from tests/PhpPowerpoint/Tests/Shape/Chart/Type/Bar3DTest.php rename to tests/PhpPresentation/Tests/Shape/Chart/Type/Bar3DTest.php index 6b51f5f74..021d3dc78 100644 --- a/tests/PhpPowerpoint/Tests/Shape/Chart/Type/Bar3DTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/Type/Bar3DTest.php @@ -1,29 +1,29 @@ assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Bar3D', $object->setData()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Bar3D', $object->setData()); $this->assertEmpty($object->getData()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Bar3D', $object->setData($array)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Bar3D', $object->setData($array)); $this->assertCount(count($array), $object->getData()); } @@ -49,7 +49,7 @@ public function testSeries() { $object = new Bar3D(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Bar3D', $object->addSeries(new Series())); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Bar3D', $object->addSeries(new Series())); $this->assertCount(1, $object->getData()); } @@ -57,9 +57,9 @@ public function testBarDirection() { $object = new Bar3D(); $this->assertEquals(Bar3D::DIRECTION_VERTICAL, $object->getBarDirection()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Bar3D', $object->setBarDirection(Bar3D::DIRECTION_HORIZONTAL)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Bar3D', $object->setBarDirection(Bar3D::DIRECTION_HORIZONTAL)); $this->assertEquals(Bar3D::DIRECTION_HORIZONTAL, $object->getBarDirection()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Bar3D', $object->setBarDirection(Bar3D::DIRECTION_VERTICAL)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Bar3D', $object->setBarDirection(Bar3D::DIRECTION_VERTICAL)); $this->assertEquals(Bar3D::DIRECTION_VERTICAL, $object->getBarDirection()); } @@ -67,11 +67,11 @@ public function testBarGrouping() { $object = new Bar3D(); $this->assertEquals(Bar3D::GROUPING_CLUSTERED, $object->getBarGrouping()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Bar3D', $object->setBarGrouping(Bar3D::GROUPING_CLUSTERED)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Bar3D', $object->setBarGrouping(Bar3D::GROUPING_CLUSTERED)); $this->assertEquals(Bar3D::GROUPING_CLUSTERED, $object->getBarGrouping()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Bar3D', $object->setBarGrouping(Bar3D::GROUPING_STACKED)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Bar3D', $object->setBarGrouping(Bar3D::GROUPING_STACKED)); $this->assertEquals(Bar3D::GROUPING_STACKED, $object->getBarGrouping()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Bar3D', $object->setBarGrouping(Bar3D::GROUPING_PERCENTSTACKED)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Bar3D', $object->setBarGrouping(Bar3D::GROUPING_PERCENTSTACKED)); $this->assertEquals(Bar3D::GROUPING_PERCENTSTACKED, $object->getBarGrouping()); } diff --git a/tests/PhpPowerpoint/Tests/Shape/Chart/Type/BarTest.php b/tests/PhpPresentation/Tests/Shape/Chart/Type/BarTest.php similarity index 54% rename from tests/PhpPowerpoint/Tests/Shape/Chart/Type/BarTest.php rename to tests/PhpPresentation/Tests/Shape/Chart/Type/BarTest.php index 6126942e1..eba91bbc9 100644 --- a/tests/PhpPowerpoint/Tests/Shape/Chart/Type/BarTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/Type/BarTest.php @@ -1,29 +1,29 @@ assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Bar', $object->setData()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Bar', $object->setData()); $this->assertEmpty($object->getData()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Bar', $object->setData($array)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Bar', $object->setData($array)); $this->assertCount(count($array), $object->getData()); } @@ -49,7 +49,7 @@ public function testSeries() { $object = new Bar(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Bar', $object->addSeries(new Series())); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Bar', $object->addSeries(new Series())); $this->assertCount(1, $object->getData()); } @@ -57,9 +57,9 @@ public function testBarDirection() { $object = new Bar(); $this->assertEquals(Bar::DIRECTION_VERTICAL, $object->getBarDirection()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Bar', $object->setBarDirection(Bar::DIRECTION_HORIZONTAL)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Bar', $object->setBarDirection(Bar::DIRECTION_HORIZONTAL)); $this->assertEquals(Bar::DIRECTION_HORIZONTAL, $object->getBarDirection()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Bar', $object->setBarDirection(Bar::DIRECTION_VERTICAL)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Bar', $object->setBarDirection(Bar::DIRECTION_VERTICAL)); $this->assertEquals(Bar::DIRECTION_VERTICAL, $object->getBarDirection()); } @@ -67,11 +67,11 @@ public function testBarGrouping() { $object = new Bar(); $this->assertEquals(Bar::GROUPING_CLUSTERED, $object->getBarGrouping()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Bar', $object->setBarGrouping(Bar::GROUPING_CLUSTERED)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Bar', $object->setBarGrouping(Bar::GROUPING_CLUSTERED)); $this->assertEquals(Bar::GROUPING_CLUSTERED, $object->getBarGrouping()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Bar', $object->setBarGrouping(Bar::GROUPING_STACKED)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Bar', $object->setBarGrouping(Bar::GROUPING_STACKED)); $this->assertEquals(Bar::GROUPING_STACKED, $object->getBarGrouping()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Bar', $object->setBarGrouping(Bar::GROUPING_PERCENTSTACKED)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Bar', $object->setBarGrouping(Bar::GROUPING_PERCENTSTACKED)); $this->assertEquals(Bar::GROUPING_PERCENTSTACKED, $object->getBarGrouping()); } diff --git a/tests/PhpPowerpoint/Tests/Shape/Chart/Type/LineTest.php b/tests/PhpPresentation/Tests/Shape/Chart/Type/LineTest.php similarity index 56% rename from tests/PhpPowerpoint/Tests/Shape/Chart/Type/LineTest.php rename to tests/PhpPresentation/Tests/Shape/Chart/Type/LineTest.php index ca4e08196..96471cb76 100644 --- a/tests/PhpPowerpoint/Tests/Shape/Chart/Type/LineTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/Type/LineTest.php @@ -1,29 +1,29 @@ assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Line', $object->setData()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Line', $object->setData()); $this->assertEmpty($object->getData()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Line', $object->setData($array)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Line', $object->setData($array)); $this->assertCount(count($array), $object->getData()); } @@ -49,7 +49,7 @@ public function testSerties() { $object = new Line(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Line', $object->addSeries(new Series())); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Line', $object->addSeries(new Series())); $this->assertCount(1, $object->getData()); } diff --git a/tests/PhpPowerpoint/Tests/Shape/Chart/Type/Pie3DTest.php b/tests/PhpPresentation/Tests/Shape/Chart/Type/Pie3DTest.php similarity index 57% rename from tests/PhpPowerpoint/Tests/Shape/Chart/Type/Pie3DTest.php rename to tests/PhpPresentation/Tests/Shape/Chart/Type/Pie3DTest.php index 2b5895e24..da3c96ac5 100644 --- a/tests/PhpPowerpoint/Tests/Shape/Chart/Type/Pie3DTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/Type/Pie3DTest.php @@ -1,29 +1,29 @@ assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Pie3D', $object->setData()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Pie3D', $object->setData()); $this->assertEmpty($object->getData()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Pie3D', $object->setData($array)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Pie3D', $object->setData($array)); $this->assertCount(count($array), $object->getData()); } @@ -49,7 +49,7 @@ public function testSeries() { $object = new Pie3D(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Pie3D', $object->addSeries(new Series())); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Pie3D', $object->addSeries(new Series())); $this->assertCount(1, $object->getData()); } @@ -60,7 +60,7 @@ public function testExplosion() $object = new Pie3D(); $this->assertEquals(0, $object->getExplosion()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Pie3D', $object->setExplosion($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Pie3D', $object->setExplosion($value)); $this->assertEquals($value, $object->getExplosion()); } diff --git a/tests/PhpPowerpoint/Tests/Shape/Chart/Type/PieTest.php b/tests/PhpPresentation/Tests/Shape/Chart/Type/PieTest.php similarity index 56% rename from tests/PhpPowerpoint/Tests/Shape/Chart/Type/PieTest.php rename to tests/PhpPresentation/Tests/Shape/Chart/Type/PieTest.php index 57625978b..d4a7b4661 100644 --- a/tests/PhpPowerpoint/Tests/Shape/Chart/Type/PieTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/Type/PieTest.php @@ -1,29 +1,29 @@ assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Pie', $object->setData()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Pie', $object->setData()); $this->assertEmpty($object->getData()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Pie', $object->setData($array)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Pie', $object->setData($array)); $this->assertCount(count($array), $object->getData()); } @@ -49,7 +49,7 @@ public function testSeries() { $object = new Pie(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Pie', $object->addSeries(new Series())); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Pie', $object->addSeries(new Series())); $this->assertCount(1, $object->getData()); } diff --git a/tests/PhpPowerpoint/Tests/Shape/Chart/Type/ScatterTest.php b/tests/PhpPresentation/Tests/Shape/Chart/Type/ScatterTest.php similarity index 56% rename from tests/PhpPowerpoint/Tests/Shape/Chart/Type/ScatterTest.php rename to tests/PhpPresentation/Tests/Shape/Chart/Type/ScatterTest.php index d84b97a85..264658e0d 100644 --- a/tests/PhpPowerpoint/Tests/Shape/Chart/Type/ScatterTest.php +++ b/tests/PhpPresentation/Tests/Shape/Chart/Type/ScatterTest.php @@ -1,29 +1,29 @@ assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Scatter', $object->setData()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Scatter', $object->setData()); $this->assertEmpty($object->getData()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Scatter', $object->setData($array)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Scatter', $object->setData($array)); $this->assertCount(count($array), $object->getData()); } @@ -49,7 +49,7 @@ public function testSerties() { $object = new Scatter(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart\\Type\\Scatter', $object->addSeries(new Series())); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Type\\Scatter', $object->addSeries(new Series())); $this->assertCount(1, $object->getData()); } diff --git a/tests/PhpPresentation/Tests/Shape/Chart/View3DTest.php b/tests/PhpPresentation/Tests/Shape/Chart/View3DTest.php new file mode 100644 index 000000000..720376be8 --- /dev/null +++ b/tests/PhpPresentation/Tests/Shape/Chart/View3DTest.php @@ -0,0 +1,105 @@ +assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\View3D', $object->setDepthPercent()); + $this->assertEquals(100, $object->getDepthPercent()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\View3D', $object->setDepthPercent($value)); + $this->assertEquals($value, $object->getDepthPercent()); + } + + public function testHashIndex() + { + $object = new View3D(); + $value = rand(1, 100); + + $this->assertEmpty($object->getHashIndex()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\View3D', $object->setHashIndex($value)); + $this->assertEquals($value, $object->getHashIndex()); + } + + public function testHeightPercent() + { + $object = new View3D(); + $value = rand(5, 500); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\View3D', $object->setHeightPercent()); + $this->assertEquals(100, $object->getHeightPercent()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\View3D', $object->setHeightPercent($value)); + $this->assertEquals($value, $object->getHeightPercent()); + } + + public function testPerspective() + { + $object = new View3D(); + $value = rand(0, 100); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\View3D', $object->setPerspective()); + $this->assertEquals(30, $object->getPerspective()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\View3D', $object->setPerspective($value)); + $this->assertEquals($value, $object->getPerspective()); + } + + public function testRightAngleAxes() + { + $object = new View3D(); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\View3D', $object->setRightAngleAxes()); + $this->assertTrue($object->hasRightAngleAxes()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\View3D', $object->setRightAngleAxes(true)); + $this->assertTrue($object->hasRightAngleAxes()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\View3D', $object->setRightAngleAxes(false)); + $this->assertFalse($object->hasRightAngleAxes()); + } + + public function testRotationX() + { + $object = new View3D(); + $value = rand(-90, 90); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\View3D', $object->setRotationX()); + $this->assertEquals(0, $object->getRotationX()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\View3D', $object->setRotationX($value)); + $this->assertEquals($value, $object->getRotationX()); + } + + public function testRotationY() + { + $object = new View3D(); + $value = rand(-90, 90); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\View3D', $object->setRotationY()); + $this->assertEquals(0, $object->getRotationY()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\View3D', $object->setRotationY($value)); + $this->assertEquals($value, $object->getRotationY()); + } +} diff --git a/tests/PhpPresentation/Tests/Shape/ChartTest.php b/tests/PhpPresentation/Tests/Shape/ChartTest.php new file mode 100644 index 000000000..4ff2ff232 --- /dev/null +++ b/tests/PhpPresentation/Tests/Shape/ChartTest.php @@ -0,0 +1,65 @@ +assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Title', $object->getTitle()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Legend', $object->getLegend()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\PlotArea', $object->getPlotArea()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\View3D', $object->getView3D()); + } + + + public function testClone() + { + $object = new Chart(); + + $oClone = clone $object; + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart', $oClone); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Title', $oClone->getTitle()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Legend', $oClone->getLegend()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\PlotArea', $oClone->getPlotArea()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\View3D', $oClone->getView3D()); + } + + public function testIncludeSpreadsheet() + { + $object = new Chart(); + + $this->assertFalse($object->hasIncludedSpreadsheet()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart', $object->setIncludeSpreadsheet()); + $this->assertFalse($object->hasIncludedSpreadsheet()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart', $object->setIncludeSpreadsheet(false)); + $this->assertFalse($object->hasIncludedSpreadsheet()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart', $object->setIncludeSpreadsheet(true)); + $this->assertTrue($object->hasIncludedSpreadsheet()); + } +} diff --git a/tests/PhpPowerpoint/Tests/Shape/DrawingTest.php b/tests/PhpPresentation/Tests/Shape/DrawingTest.php similarity index 61% rename from tests/PhpPowerpoint/Tests/Shape/DrawingTest.php rename to tests/PhpPresentation/Tests/Shape/DrawingTest.php index 059519d1b..118fd699f 100644 --- a/tests/PhpPowerpoint/Tests/Shape/DrawingTest.php +++ b/tests/PhpPresentation/Tests/Shape/DrawingTest.php @@ -1,28 +1,28 @@ assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Drawing', $object->setPath()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Drawing', $object->setPath()); } public function testPathWithoutVerifyFile() { $object = new Drawing(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Drawing', $object->setPath('', false)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Drawing', $object->setPath('', false)); $this->assertEmpty($object->getPath()); } @@ -56,9 +56,9 @@ public function testPathWithRealFile() { $object = new Drawing(); - $imagePath = PHPPOWERPOINT_TESTS_BASE_DIR.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'images'.DIRECTORY_SEPARATOR.'PHPPowerPointLogo.png'; + $imagePath = PHPPRESENTATION_TESTS_BASE_DIR.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'images'.DIRECTORY_SEPARATOR.'PhpPresentationLogo.png'; - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Drawing', $object->setPath($imagePath, false)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Drawing', $object->setPath($imagePath, false)); $this->assertEquals($imagePath, $object->getPath()); $this->assertEquals(0, $object->getWidth()); $this->assertEquals(0, $object->getHeight()); @@ -68,10 +68,10 @@ public function testGetSetDescription() { $object = new Drawing(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Drawing', $object->setDescription()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Drawing', $object->setDescription()); $this->assertEmpty($object->getDescription()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Drawing', $object->setDescription('TEST')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Drawing', $object->setDescription('TEST')); $this->assertEquals('TEST', $object->getDescription()); } @@ -79,12 +79,12 @@ public function testGetSetResizeProportional() { $object = new Drawing(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Drawing', $object->setResizeProportional()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Drawing', $object->setResizeProportional()); $this->assertTrue($object->isResizeProportional()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Drawing', $object->setResizeProportional(false)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Drawing', $object->setResizeProportional(false)); $this->assertFalse($object->isResizeProportional()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Drawing', $object->setResizeProportional(true)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Drawing', $object->setResizeProportional(true)); $this->assertTrue($object->isResizeProportional()); } @@ -92,9 +92,9 @@ public function testGetSetHeightWidth() { $object = new Drawing(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Drawing', $object->setWidth()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Drawing', $object->setWidth()); $this->assertEquals(0, $object->getWidth()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Drawing', $object->setHeight()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Drawing', $object->setHeight()); $this->assertEquals(0, $object->getHeight()); } /** @@ -106,9 +106,9 @@ public function testGetSetHeightWidthResizeProportionalFalse() $object = new Drawing(); $value = rand(0, 100); $object->setResizeProportional(false); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Drawing', $object->setWidth($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Drawing', $object->setWidth($value)); $this->assertEquals($value, $object->getWidth()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Drawing', $object->setHeight($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Drawing', $object->setHeight($value)); $this->assertEquals($value, $object->getHeight()); } @@ -124,10 +124,10 @@ public function testGetSetHeightWidthResizeProportionalTrue() $object->setWidth($valueWidth); $object->setHeight($valueHeight); $object->setResizeProportional(true); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Drawing', $object->setWidth($valueWidth)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Drawing', $object->setWidth($valueWidth)); $this->assertEquals($valueWidth, $object->getWidth()); $this->assertEquals(round($valueWidth * ($valueHeight / $valueWidth)), $object->getHeight()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Drawing', $object->setHeight($valueHeight)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Drawing', $object->setHeight($valueHeight)); $this->assertEquals($valueHeight, $object->getHeight()); $this->assertEquals(round($valueHeight * ($valueWidth / $valueHeight)), $object->getWidth()); } @@ -141,7 +141,7 @@ public function testSetWidthAndHeight() $object->setWidth($valueWidth); $object->setHeight($valueHeight); $object->setResizeProportional(true); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Drawing', $object->setWidthAndHeight($valueHeight, $valueWidth)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Drawing', $object->setWidthAndHeight($valueHeight, $valueWidth)); $this->assertEquals($valueHeight, $object->getWidth()); $this->assertEquals(ceil($valueHeight * ($valueHeight/$valueWidth)), $object->getHeight()); @@ -152,7 +152,7 @@ public function testSetWidthAndHeight() $object->setWidth($valueWidth); $object->setHeight($valueHeight); $object->setResizeProportional(true); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Drawing', $object->setWidthAndHeight($valueWidth, $valueHeight)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Drawing', $object->setWidthAndHeight($valueWidth, $valueHeight)); $this->assertEquals($valueHeight, $object->getHeight()); $this->assertEquals(ceil($valueWidth * ($valueHeight/$valueHeight)), $object->getWidth()); } diff --git a/tests/PhpPowerpoint/Tests/Shape/GroupTest.php b/tests/PhpPresentation/Tests/Shape/GroupTest.php similarity index 69% rename from tests/PhpPowerpoint/Tests/Shape/GroupTest.php rename to tests/PhpPresentation/Tests/Shape/GroupTest.php index 9f019cdfb..77ab387a0 100644 --- a/tests/PhpPowerpoint/Tests/Shape/GroupTest.php +++ b/tests/PhpPresentation/Tests/Shape/GroupTest.php @@ -1,29 +1,29 @@ assertEquals(0, $object->getExtentX()); $this->assertEquals(0, $object->getExtentY()); $this->assertEquals(0, $object->getShapeCollection()->count()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Group', $object->setWidth(rand(1, 100))); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Group', $object->setHeight(rand(1, 100))); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Group', $object->setWidth(rand(1, 100))); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Group', $object->setHeight(rand(1, 100))); } public function testAdd() { $object = new Group(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Chart', $object->createChartShape()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Drawing', $object->createDrawingShape()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Line', $object->createLineShape(10, 10, 10, 10)); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->createRichTextShape()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Table', $object->createTableShape()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart', $object->createChartShape()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Drawing', $object->createDrawingShape()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Line', $object->createLineShape(10, 10, 10, 10)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->createRichTextShape()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Table', $object->createTableShape()); $this->assertEquals(5, $object->getShapeCollection()->count()); } @@ -78,7 +78,7 @@ public function testOffsetX() $this->assertEquals(10, $object->getOffsetX()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Group', $object->setOffsetX(rand(1, 100))); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Group', $object->setOffsetX(rand(1, 100))); $this->assertEquals(10, $object->getOffsetX()); } @@ -90,14 +90,14 @@ public function testOffsetY() $this->assertEquals(20, $object->getOffsetY()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Group', $object->setOffsetY(rand(1, 100))); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Group', $object->setOffsetY(rand(1, 100))); $this->assertEquals(20, $object->getOffsetY()); } public function testExtentsAndOffsetsForOneShape() { // We record initial values here because - // PhpOffice\PhpPowerpoint\Shape\Line subtracts the offsets + // PhpOffice\PhpPresentation\Shape\Line subtracts the offsets // from the extents to produce a raw width and height. $offsetX = 100; $offsetY = 100; diff --git a/tests/PhpPowerpoint/Tests/Shape/HyperlinkTest.php b/tests/PhpPresentation/Tests/Shape/HyperlinkTest.php similarity index 66% rename from tests/PhpPowerpoint/Tests/Shape/HyperlinkTest.php rename to tests/PhpPresentation/Tests/Shape/HyperlinkTest.php index 1843f68f6..85e241807 100644 --- a/tests/PhpPowerpoint/Tests/Shape/HyperlinkTest.php +++ b/tests/PhpPresentation/Tests/Shape/HyperlinkTest.php @@ -1,28 +1,28 @@ assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Hyperlink', $object->setSlideNumber()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Hyperlink', $object->setSlideNumber()); $this->assertEquals(1, $object->getSlideNumber()); $this->assertEquals('ppaction://hlinksldjump', $object->getUrl()); $value = rand(1, 100); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Hyperlink', $object->setSlideNumber($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Hyperlink', $object->setSlideNumber($value)); $this->assertEquals($value, $object->getSlideNumber()); $this->assertEquals('ppaction://hlinksldjump', $object->getUrl()); } @@ -89,10 +89,10 @@ public function testGetSetTooltip() { $object = new Hyperlink(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Hyperlink', $object->setTooltip()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Hyperlink', $object->setTooltip()); $this->assertEmpty($object->getTooltip()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Hyperlink', $object->setTooltip('TEST')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Hyperlink', $object->setTooltip('TEST')); $this->assertEquals('TEST', $object->getTooltip()); } @@ -100,10 +100,10 @@ public function testGetSetUrl() { $object = new Hyperlink(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Hyperlink', $object->setUrl()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Hyperlink', $object->setUrl()); $this->assertEmpty($object->getUrl()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Hyperlink', $object->setUrl('http://www.github.com')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Hyperlink', $object->setUrl('http://www.github.com')); $this->assertEquals('http://www.github.com', $object->getUrl()); } @@ -111,10 +111,10 @@ public function testIsInternal() { $object = new Hyperlink(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Hyperlink', $object->setSlideNumber()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Hyperlink', $object->setSlideNumber()); $this->assertTrue($object->isInternal()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Hyperlink', $object->setUrl('http://www.github.com')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Hyperlink', $object->setUrl('http://www.github.com')); $this->assertFalse($object->isInternal()); } } diff --git a/tests/PhpPowerpoint/Tests/Shape/LineTest.php b/tests/PhpPresentation/Tests/Shape/LineTest.php similarity index 64% rename from tests/PhpPowerpoint/Tests/Shape/LineTest.php rename to tests/PhpPresentation/Tests/Shape/LineTest.php index ab08158d2..cac59a992 100644 --- a/tests/PhpPowerpoint/Tests/Shape/LineTest.php +++ b/tests/PhpPresentation/Tests/Shape/LineTest.php @@ -1,29 +1,29 @@ assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\MemoryDrawing', $object->setImageResource()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\MemoryDrawing', $object->setImageResource()); $this->assertNull($object->getImageResource()); $this->assertEquals(0, $object->getWidth()); $this->assertEquals(0, $object->getHeight()); @@ -53,7 +53,7 @@ public function testImageResource() $width = rand(1, 100); $height = rand(100, 200); $gdImage = @imagecreatetruecolor($width, $height); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\MemoryDrawing', $object->setImageResource($gdImage)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\MemoryDrawing', $object->setImageResource($gdImage)); $this->assertTrue(is_resource($object->getImageResource())); $this->assertEquals($width, $object->getWidth()); $this->assertEquals($height, $object->getHeight()); @@ -63,10 +63,10 @@ public function testMimeType() { $object = new MemoryDrawing(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\MemoryDrawing', $object->setMimeType()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\MemoryDrawing', $object->setMimeType()); $this->assertEquals(MemoryDrawing::MIMETYPE_DEFAULT, $object->getMimeType()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\MemoryDrawing', $object->setMimeType(MemoryDrawing::MIMETYPE_JPEG)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\MemoryDrawing', $object->setMimeType(MemoryDrawing::MIMETYPE_JPEG)); $this->assertEquals(MemoryDrawing::MIMETYPE_JPEG, $object->getMimeType()); } @@ -74,10 +74,10 @@ public function testRenderingFunction() { $object = new MemoryDrawing(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\MemoryDrawing', $object->setRenderingFunction()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\MemoryDrawing', $object->setRenderingFunction()); $this->assertEquals(MemoryDrawing::RENDERING_DEFAULT, $object->getRenderingFunction()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\MemoryDrawing', $object->setRenderingFunction(MemoryDrawing::RENDERING_JPEG)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\MemoryDrawing', $object->setRenderingFunction(MemoryDrawing::RENDERING_JPEG)); $this->assertEquals(MemoryDrawing::RENDERING_JPEG, $object->getRenderingFunction()); } } diff --git a/tests/PhpPowerpoint/Tests/Shape/RichText/BreakElementTest.php b/tests/PhpPresentation/Tests/Shape/RichText/BreakElementTest.php similarity index 58% rename from tests/PhpPowerpoint/Tests/Shape/RichText/BreakElementTest.php rename to tests/PhpPresentation/Tests/Shape/RichText/BreakElementTest.php index 973b8f105..6fb7f598b 100644 --- a/tests/PhpPowerpoint/Tests/Shape/RichText/BreakElementTest.php +++ b/tests/PhpPresentation/Tests/Shape/RichText/BreakElementTest.php @@ -1,28 +1,28 @@ assertEquals("\r\n", $object->getText()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\BreakElement', $object->setText()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\BreakElement', $object->setText()); $this->assertEquals("\r\n", $object->getText()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\BreakElement', $object->setText('AAA')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\BreakElement', $object->setText('AAA')); $this->assertEquals("\r\n", $object->getText()); } diff --git a/tests/PhpPresentation/Tests/Shape/RichText/ParagraphTest.php b/tests/PhpPresentation/Tests/Shape/RichText/ParagraphTest.php new file mode 100644 index 000000000..94901999d --- /dev/null +++ b/tests/PhpPresentation/Tests/Shape/RichText/ParagraphTest.php @@ -0,0 +1,151 @@ +assertEmpty($object->getRichTextElements()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->getAlignment()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->getFont()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Bullet', $object->getBulletStyle()); + } + + public function testAlignment() + { + $object = new Paragraph(); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->getAlignment()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Paragraph', $object->setAlignment(new Alignment())); + } + + /** + * Test get/set bullet style + */ + public function testBulletStyle() + { + $object = new Paragraph(); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Bullet', $object->getBulletStyle()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Paragraph', $object->setBulletStyle()); + $this->assertNull($object->getBulletStyle()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Paragraph', $object->setBulletStyle(new Bullet())); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Bullet', $object->getBulletStyle()); + } + + /** + * Test get/set font + */ + public function testFont() + { + $object = new Paragraph(); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->getFont()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Paragraph', $object->setFont()); + $this->assertNull($object->getFont()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Paragraph', $object->setFont(new Font())); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->getFont()); + } + + /** + * Test get/set hashCode + */ + public function testHashCode() + { + $object = new Paragraph(); + $oElement = new TextElement(); + $object->addText($oElement); + $this->assertEquals(md5($oElement->getHashCode().$object->getFont()->getHashCode().get_class($object)), $object->getHashCode()); + } + + /** + * Test get/set hashIndex + */ + public function testHashIndex() + { + $object = new Paragraph(); + $value = rand(1, 100); + $object->setHashIndex($value); + $this->assertEquals($value, $object->getHashIndex()); + } + + /** + * Test get/set richTextElements + */ + public function testRichTextElements() + { + $object = new Paragraph(); + $this->assertInternalType('array', $object->getRichTextElements()); + $this->assertEmpty($object->getRichTextElements()); + $object->createBreak(); + $this->assertCount(1, $object->getRichTextElements()); + + $array = array( + new TextElement(), + new TextElement(), + new TextElement(), + ); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Paragraph', $object->setRichTextElements($array)); + $this->assertCount(3, $object->getRichTextElements()); + } + + /** + * @expectedException \Exception + * expectedExceptionMessage Invalid \PhpOffice\PhpPresentation\Shape\RichText\TextElementInterface[] array passed. + */ + public function testRichTextElementsException() + { + $object = new Paragraph(); + $object->setRichTextElements(1); + } + + /** + * Test text methods + */ + public function testText() + { + $object = new Paragraph(); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Paragraph', $object->addText(new TextElement())); + $this->assertcount(1, $object->getRichTextElements()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\TextElement', $object->createText()); + $this->assertcount(2, $object->getRichTextElements()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\TextElement', $object->createText('AAA')); + $this->assertcount(3, $object->getRichTextElements()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\BreakElement', $object->createBreak()); + $this->assertcount(4, $object->getRichTextElements()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $object->createTextRun()); + $this->assertcount(5, $object->getRichTextElements()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $object->createTextRun('BBB')); + $this->assertcount(6, $object->getRichTextElements()); + $this->assertEquals('AAA'."\r\n".'BBB', $object->getPlainText()); + $this->assertEquals('AAA'."\r\n".'BBB', (string) $object); + } +} diff --git a/tests/PhpPowerpoint/Tests/Shape/RichText/RunTest.php b/tests/PhpPresentation/Tests/Shape/RichText/RunTest.php similarity index 52% rename from tests/PhpPowerpoint/Tests/Shape/RichText/RunTest.php rename to tests/PhpPresentation/Tests/Shape/RichText/RunTest.php index a462c1440..2739d9929 100644 --- a/tests/PhpPowerpoint/Tests/Shape/RichText/RunTest.php +++ b/tests/PhpPresentation/Tests/Shape/RichText/RunTest.php @@ -1,29 +1,29 @@ assertEquals('', $object->getText()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->getFont()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->getFont()); $object = new Run('BBB'); $this->assertEquals('BBB', $object->getText()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->getFont()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->getFont()); } public function testFont() { $object = new Run(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\Run', $object->setFont(new Font())); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->getFont()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $object->setFont(new Font())); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->getFont()); } public function testText() { $object = new Run(); $this->assertEquals('', $object->getText()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\Run', $object->setText()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $object->setText()); $this->assertEquals('', $object->getText()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\Run', $object->setText('AAA')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $object->setText('AAA')); $this->assertEquals('AAA', $object->getText()); $object = new Run('BBB'); diff --git a/tests/PhpPowerpoint/Tests/Shape/RichText/TextElementTest.php b/tests/PhpPresentation/Tests/Shape/RichText/TextElementTest.php similarity index 55% rename from tests/PhpPowerpoint/Tests/Shape/RichText/TextElementTest.php rename to tests/PhpPresentation/Tests/Shape/RichText/TextElementTest.php index 50cf84529..0ceafb787 100644 --- a/tests/PhpPowerpoint/Tests/Shape/RichText/TextElementTest.php +++ b/tests/PhpPresentation/Tests/Shape/RichText/TextElementTest.php @@ -1,29 +1,29 @@ assertFalse($object->hasHyperlink()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\TextElement', $object->setHyperlink()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\TextElement', $object->setHyperlink()); $this->assertFalse($object->hasHyperlink()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Hyperlink', $object->getHyperlink()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Hyperlink', $object->getHyperlink()); $this->assertTrue($object->hasHyperlink()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\TextElement', $object->setHyperlink(new Hyperlink('http://www.google.fr'))); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\TextElement', $object->setHyperlink(new Hyperlink('http://www.google.fr'))); $this->assertTrue($object->hasHyperlink()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Hyperlink', $object->getHyperlink()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Hyperlink', $object->getHyperlink()); } public function testText() { $object = new TextElement(); $this->assertEquals('', $object->getText()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\TextElement', $object->setText()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\TextElement', $object->setText()); $this->assertEquals('', $object->getText()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\TextElement', $object->setText('AAA')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\TextElement', $object->setText('AAA')); $this->assertEquals('AAA', $object->getText()); } diff --git a/tests/PhpPowerpoint/Tests/Shape/RichTextTest.php b/tests/PhpPresentation/Tests/Shape/RichTextTest.php similarity index 53% rename from tests/PhpPowerpoint/Tests/Shape/RichTextTest.php rename to tests/PhpPresentation/Tests/Shape/RichTextTest.php index 1c3f4131a..07cac16fc 100644 --- a/tests/PhpPowerpoint/Tests/Shape/RichTextTest.php +++ b/tests/PhpPresentation/Tests/Shape/RichTextTest.php @@ -1,30 +1,30 @@ assertEquals(0, $object->getActiveParagraphIndex()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\Paragraph', $object->createParagraph()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Paragraph', $object->createParagraph()); $this->assertCount(2, $object->getParagraphs()); $value = rand(0, 1); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\Paragraph', $object->setActiveParagraph($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Paragraph', $object->setActiveParagraph($value)); $this->assertEquals($value, $object->getActiveParagraphIndex()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\Paragraph', $object->getActiveParagraph()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\Paragraph', $object->getParagraph()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Paragraph', $object->getActiveParagraph()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Paragraph', $object->getParagraph()); $value = rand(0, 1); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\Paragraph', $object->getParagraph($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Paragraph', $object->getParagraph($value)); } /** @@ -75,7 +75,7 @@ public function testColumns() $object = new RichText(); $value = rand(1, 16); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setColumns($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setColumns($value)); $this->assertEquals($value, $object->getColumns()); } @@ -99,14 +99,14 @@ public function testParagraphs() new Paragraph(), ); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setParagraphs($array)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setParagraphs($array)); $this->assertCount(3, $object->getParagraphs()); $this->assertEquals(2, $object->getActiveParagraphIndex()); } /** * @expectedException \Exception - * expectedExceptionMessage Invalid \PhpOffice\PhpPowerpoint\Shape\RichText\Paragraph[] array passed. + * expectedExceptionMessage Invalid \PhpOffice\PhpPresentation\Shape\RichText\Paragraph[] array passed. */ public function testParagraphsException() { @@ -117,19 +117,19 @@ public function testParagraphsException() public function testText() { $object = new RichText(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->addText()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->addText()); $this->assertCount(1, $object->getActiveParagraph()->getRichTextElements()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->addText(new TextElement())); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->addText(new TextElement())); $this->assertCount(2, $object->getActiveParagraph()->getRichTextElements()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\TextElement', $object->createText()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\TextElement', $object->createText()); $this->assertCount(3, $object->getActiveParagraph()->getRichTextElements()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\TextElement', $object->createText('ALPHA')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\TextElement', $object->createText('ALPHA')); $this->assertCount(4, $object->getActiveParagraph()->getRichTextElements()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\BreakElement', $object->createBreak()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\BreakElement', $object->createBreak()); $this->assertCount(5, $object->getActiveParagraph()->getRichTextElements()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\Run', $object->createTextRun()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $object->createTextRun()); $this->assertCount(6, $object->getActiveParagraph()->getRichTextElements()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\Run', $object->createTextRun('BETA')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $object->createTextRun('BETA')); $this->assertCount(7, $object->getActiveParagraph()->getRichTextElements()); $this->assertEquals('ALPHA'."\r\n".'BETA', $object->getPlainText()); $this->assertEquals('ALPHA'."\r\n".'BETA', (string) $object); @@ -139,10 +139,10 @@ public function testGetSetAutoFit() { $object = new RichText(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setAutoFit()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setAutoFit()); $this->assertEquals(RichText::AUTOFIT_DEFAULT, $object->getAutoFit()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setAutoFit(RichText::AUTOFIT_NORMAL)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setAutoFit(RichText::AUTOFIT_NORMAL)); $this->assertEquals(RichText::AUTOFIT_NORMAL, $object->getAutoFit()); } @@ -150,32 +150,32 @@ public function testGetSetHAutoShrink() { $object = new RichText(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setAutoShrinkHorizontal()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setAutoShrinkHorizontal()); $this->assertNull($object->hasAutoShrinkHorizontal()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setAutoShrinkHorizontal(2)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setAutoShrinkHorizontal(2)); $this->assertNull($object->hasAutoShrinkHorizontal()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setAutoShrinkHorizontal(true)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setAutoShrinkHorizontal(true)); $this->assertTrue($object->hasAutoShrinkHorizontal()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setAutoShrinkHorizontal(false)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setAutoShrinkHorizontal(false)); $this->assertFalse($object->hasAutoShrinkHorizontal()); } public function testGetSetVAutoShrink() { $object = new RichText(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setAutoShrinkVertical()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setAutoShrinkVertical()); $this->assertNull($object->hasAutoShrinkVertical()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setAutoShrinkVertical(2)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setAutoShrinkVertical(2)); $this->assertNull($object->hasAutoShrinkVertical()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setAutoShrinkVertical(true)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setAutoShrinkVertical(true)); $this->assertTrue($object->hasAutoShrinkVertical()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setAutoShrinkVertical(false)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setAutoShrinkVertical(false)); $this->assertFalse($object->hasAutoShrinkVertical()); } @@ -183,10 +183,10 @@ public function testGetSetHOverflow() { $object = new RichText(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setHorizontalOverflow()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setHorizontalOverflow()); $this->assertEquals(RichText::OVERFLOW_OVERFLOW, $object->getHorizontalOverflow()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setHorizontalOverflow(RichText::OVERFLOW_CLIP)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setHorizontalOverflow(RichText::OVERFLOW_CLIP)); $this->assertEquals(RichText::OVERFLOW_CLIP, $object->getHorizontalOverflow()); } @@ -195,24 +195,24 @@ public function testGetSetInset() $object = new RichText(); // Default - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setInsetBottom()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setInsetBottom()); $this->assertEquals(4.8, $object->getInsetBottom()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setInsetLeft()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setInsetLeft()); $this->assertEquals(9.6, $object->getInsetLeft()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setInsetRight()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setInsetRight()); $this->assertEquals(9.6, $object->getInsetRight()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setInsetTop()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setInsetTop()); $this->assertEquals(4.8, $object->getInsetTop()); // Value $value = rand(1, 100); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setInsetBottom($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setInsetBottom($value)); $this->assertEquals($value, $object->getInsetBottom()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setInsetLeft($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setInsetLeft($value)); $this->assertEquals($value, $object->getInsetLeft()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setInsetRight($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setInsetRight($value)); $this->assertEquals($value, $object->getInsetRight()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setInsetTop($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setInsetTop($value)); $this->assertEquals($value, $object->getInsetTop()); } @@ -220,13 +220,13 @@ public function testGetSetUpright() { $object = new RichText(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setUpright()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setUpright()); $this->assertFalse($object->isUpright()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setUpright(true)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setUpright(true)); $this->assertTrue($object->isUpright()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setUpright(false)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setUpright(false)); $this->assertFalse($object->isUpright()); } @@ -234,13 +234,13 @@ public function testGetSetVertical() { $object = new RichText(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setVertical()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setVertical()); $this->assertFalse($object->isVertical()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setVertical(true)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setVertical(true)); $this->assertTrue($object->isVertical()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setVertical(false)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setVertical(false)); $this->assertFalse($object->isVertical()); } @@ -248,10 +248,10 @@ public function testGetSetVOverflow() { $object = new RichText(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setVerticalOverflow()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setVerticalOverflow()); $this->assertEquals(RichText::OVERFLOW_OVERFLOW, $object->getVerticalOverflow()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setVerticalOverflow(RichText::OVERFLOW_CLIP)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setVerticalOverflow(RichText::OVERFLOW_CLIP)); $this->assertEquals(RichText::OVERFLOW_CLIP, $object->getVerticalOverflow()); } @@ -259,10 +259,10 @@ public function testGetSetWrap() { $object = new RichText(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setWrap()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setWrap()); $this->assertEquals(RichText::WRAP_SQUARE, $object->getWrap()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->setWrap(RichText::WRAP_NONE)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->setWrap(RichText::WRAP_NONE)); $this->assertEquals(RichText::WRAP_NONE, $object->getWrap()); } diff --git a/tests/PhpPowerpoint/Tests/Shape/Table/CellTest.php b/tests/PhpPresentation/Tests/Shape/Table/CellTest.php similarity index 52% rename from tests/PhpPowerpoint/Tests/Shape/Table/CellTest.php rename to tests/PhpPresentation/Tests/Shape/Table/CellTest.php index c78a7d764..7bb993459 100644 --- a/tests/PhpPowerpoint/Tests/Shape/Table/CellTest.php +++ b/tests/PhpPresentation/Tests/Shape/Table/CellTest.php @@ -1,32 +1,32 @@ assertEquals(0, $object->getActiveParagraphIndex()); $this->assertCount(1, $object->getParagraphs()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Fill', $object->getFill()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Borders', $object->getBorders()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Fill', $object->getFill()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Borders', $object->getBorders()); } public function testActiveParagraph() { $object = new Cell(); $this->assertEquals(0, $object->getActiveParagraphIndex()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\Paragraph', $object->createParagraph()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Paragraph', $object->createParagraph()); $this->assertCount(2, $object->getParagraphs()); $value = rand(0, 1); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\Paragraph', $object->setActiveParagraph($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Paragraph', $object->setActiveParagraph($value)); $this->assertEquals($value, $object->getActiveParagraphIndex()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\Paragraph', $object->getActiveParagraph()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\Paragraph', $object->getParagraph()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Paragraph', $object->getActiveParagraph()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Paragraph', $object->getParagraph()); $value = rand(0, 1); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\Paragraph', $object->getParagraph($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Paragraph', $object->getParagraph($value)); } /** @@ -91,19 +91,19 @@ public function testSetGetHashIndex() public function testText() { $object = new Cell(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Table\\Cell', $object->addText()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Table\\Cell', $object->addText()); $this->assertCount(1, $object->getActiveParagraph()->getRichTextElements()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Table\\Cell', $object->addText(new TextElement())); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Table\\Cell', $object->addText(new TextElement())); $this->assertCount(2, $object->getActiveParagraph()->getRichTextElements()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\TextElement', $object->createText()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\TextElement', $object->createText()); $this->assertCount(3, $object->getActiveParagraph()->getRichTextElements()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\TextElement', $object->createText('ALPHA')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\TextElement', $object->createText('ALPHA')); $this->assertCount(4, $object->getActiveParagraph()->getRichTextElements()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\BreakElement', $object->createBreak()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\BreakElement', $object->createBreak()); $this->assertCount(5, $object->getActiveParagraph()->getRichTextElements()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\Run', $object->createTextRun()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $object->createTextRun()); $this->assertCount(6, $object->getActiveParagraph()->getRichTextElements()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText\\Run', $object->createTextRun('BETA')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $object->createTextRun('BETA')); $this->assertCount(7, $object->getActiveParagraph()->getRichTextElements()); $this->assertEquals('ALPHA'."\r\n".'BETA', $object->getPlainText()); $this->assertEquals('ALPHA'."\r\n".'BETA', (string) $object); @@ -119,14 +119,14 @@ public function testParagraphs() new Paragraph(), ); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Table\\Cell', $object->setParagraphs($array)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Table\\Cell', $object->setParagraphs($array)); $this->assertCount(3, $object->getParagraphs()); $this->assertEquals(2, $object->getActiveParagraphIndex()); } /** * @expectedException \Exception - * expectedExceptionMessage Invalid \PhpOffice\PhpPowerpoint\Shape\RichText\Paragraph[] array passed. + * expectedExceptionMessage Invalid \PhpOffice\PhpPresentation\Shape\RichText\Paragraph[] array passed. */ public function testParagraphsException() { @@ -138,19 +138,19 @@ public function testGetSetBorders() { $object = new Cell(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Table\\Cell', $object->setBorders(new Borders())); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Borders', $object->getBorders()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Table\\Cell', $object->setBorders(new Borders())); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Borders', $object->getBorders()); } public function testGetSetColspan() { $object = new Cell(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Table\\Cell', $object->setColSpan()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Table\\Cell', $object->setColSpan()); $this->assertEquals(0, $object->getColSpan()); $value = rand(1, 100); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Table\\Cell', $object->setColSpan($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Table\\Cell', $object->setColSpan($value)); $this->assertEquals($value, $object->getColSpan()); } @@ -158,19 +158,19 @@ public function testGetSetFill() { $object = new Cell(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Table\\Cell', $object->setFill(new Fill())); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Fill', $object->getFill()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Table\\Cell', $object->setFill(new Fill())); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Fill', $object->getFill()); } public function testGetSetRowspan() { $object = new Cell(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Table\\Cell', $object->setRowSpan()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Table\\Cell', $object->setRowSpan()); $this->assertEquals(0, $object->getRowSpan()); $value = rand(1, 100); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Table\\Cell', $object->setRowSpan($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Table\\Cell', $object->setRowSpan($value)); $this->assertEquals($value, $object->getRowSpan()); } @@ -178,11 +178,11 @@ public function testGetSetWidth() { $object = new Cell(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Table\\Cell', $object->setWidth()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Table\\Cell', $object->setWidth()); $this->assertEquals(0, $object->getWidth()); $value = rand(1, 100); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Table\\Cell', $object->setWidth($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Table\\Cell', $object->setWidth($value)); $this->assertEquals($value, $object->getWidth()); } } diff --git a/tests/PhpPowerpoint/Tests/Shape/Table/RowTest.php b/tests/PhpPresentation/Tests/Shape/Table/RowTest.php similarity index 59% rename from tests/PhpPowerpoint/Tests/Shape/Table/RowTest.php rename to tests/PhpPresentation/Tests/Shape/Table/RowTest.php index 7434cf109..8df703e23 100644 --- a/tests/PhpPowerpoint/Tests/Shape/Table/RowTest.php +++ b/tests/PhpPresentation/Tests/Shape/Table/RowTest.php @@ -1,29 +1,29 @@ assertCount(1, $object->getCells()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Fill', $object->getFill()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Fill', $object->getFill()); $value = rand(1, 100); $object = new Row($value); $this->assertCount($value, $object->getCells()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Fill', $object->getFill()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Fill', $object->getFill()); } public function testGetCell() { $object = new Row(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Table\\Cell', $object->getCell(0)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Table\\Cell', $object->getCell(0)); $this->assertNull($object->getCell(1000, true)); } @@ -64,7 +64,7 @@ public function testNextCell() { $object = new Row(2); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Table\\Cell', $object->nextCell()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Table\\Cell', $object->nextCell()); } /** @@ -93,19 +93,19 @@ public function testGetSetFill() { $object = new Row(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Table\\Row', $object->setFill(new Fill())); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Fill', $object->getFill()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Table\\Row', $object->setFill(new Fill())); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Fill', $object->getFill()); } public function testGetSetHeight() { $object = new Row(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Table\\Row', $object->setHeight()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Table\\Row', $object->setHeight()); $this->assertEquals(0, $object->getHeight()); $value = rand(1, 100); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Table\\Row', $object->setHeight($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Table\\Row', $object->setHeight($value)); $this->assertEquals($value, $object->getHeight()); } } diff --git a/tests/PhpPowerpoint/Tests/Shape/TableTest.php b/tests/PhpPresentation/Tests/Shape/TableTest.php similarity index 64% rename from tests/PhpPowerpoint/Tests/Shape/TableTest.php rename to tests/PhpPresentation/Tests/Shape/TableTest.php index 56ee5e5a3..0deea7dfd 100644 --- a/tests/PhpPowerpoint/Tests/Shape/TableTest.php +++ b/tests/PhpPresentation/Tests/Shape/TableTest.php @@ -1,28 +1,28 @@ assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Table\\Row', $object->createRow()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Table\\Row', $object->createRow()); $this->assertCount(1, $object->getRows()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Table\\Row', $object->getRow(0)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Table\\Row', $object->getRow(0)); $this->assertNull($object->getRow(1, true)); } diff --git a/tests/PhpPresentation/Tests/Slide/IteratorTest.php b/tests/PhpPresentation/Tests/Slide/IteratorTest.php new file mode 100644 index 000000000..053ea829a --- /dev/null +++ b/tests/PhpPresentation/Tests/Slide/IteratorTest.php @@ -0,0 +1,51 @@ +addSlide(new Slide()); + + $object = new Iterator($oPhpPresentation); + + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide', $object->current()); + $this->assertEquals(0, $object->key()); + $this->assertNull($object->next()); + $this->assertEquals(1, $object->key()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide', $object->current()); + $this->assertTrue($object->valid()); + $this->assertNull($object->next()); + $this->assertFalse($object->valid()); + $this->assertNull($object->rewind()); + $this->assertEquals(0, $object->key()); + } +} diff --git a/tests/PhpPowerpoint/Tests/Slide/NoteTest.php b/tests/PhpPresentation/Tests/Slide/NoteTest.php similarity index 63% rename from tests/PhpPowerpoint/Tests/Slide/NoteTest.php rename to tests/PhpPresentation/Tests/Slide/NoteTest.php index ede2bed16..b57499fa2 100644 --- a/tests/PhpPowerpoint/Tests/Slide/NoteTest.php +++ b/tests/PhpPresentation/Tests/Slide/NoteTest.php @@ -1,30 +1,30 @@ assertNull($object->getParent()); - $oPhpPowerpoint = new PhpPowerpoint(); - $oSlide = $oPhpPowerpoint->createSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->createSlide(); $oSlide->setNote($object); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide', $object->getParent()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide', $object->getParent()); } public function testExtent() @@ -67,11 +67,11 @@ public function testShape() { $object = new Note(); $this->assertEquals(0, $object->getShapeCollection()->count()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->createRichTextShape()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->createRichTextShape()); $this->assertEquals(1, $object->getShapeCollection()->count()); $oRichText = new RichText(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\RichText', $object->addShape($oRichText)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $object->addShape($oRichText)); $this->assertEquals(2, $object->getShapeCollection()->count()); } diff --git a/tests/PhpPowerpoint/Tests/Slide/TransitionTest.php b/tests/PhpPresentation/Tests/Slide/TransitionTest.php similarity index 50% rename from tests/PhpPowerpoint/Tests/Slide/TransitionTest.php rename to tests/PhpPresentation/Tests/Slide/TransitionTest.php index 531aadc4a..4b1b56dad 100644 --- a/tests/PhpPowerpoint/Tests/Slide/TransitionTest.php +++ b/tests/PhpPresentation/Tests/Slide/TransitionTest.php @@ -1,28 +1,28 @@ assertNull($object->getSpeed()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide\\Transition', $object->setSpeed()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\Transition', $object->setSpeed()); $this->assertEquals(Transition::SPEED_MEDIUM, $object->getSpeed()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide\\Transition', $object->setSpeed(Transition::SPEED_FAST)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\Transition', $object->setSpeed(Transition::SPEED_FAST)); $this->assertEquals(Transition::SPEED_FAST, $object->getSpeed()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide\\Transition', $object->setSpeed(rand(1, 1000))); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\Transition', $object->setSpeed(rand(1, 1000))); $this->assertNull($object->getSpeed()); } @@ -42,15 +42,15 @@ public function testManualTrigger() { $object = new Transition(); $this->assertFalse($object->hasManualTrigger()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide\\Transition', $object->setManualTrigger()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\Transition', $object->setManualTrigger()); $this->assertFalse($object->hasManualTrigger()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide\\Transition', $object->setManualTrigger(true)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\Transition', $object->setManualTrigger(true)); $this->assertTrue($object->hasManualTrigger()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide\\Transition', $object->setManualTrigger(null)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\Transition', $object->setManualTrigger(null)); $this->assertTrue($object->hasManualTrigger()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide\\Transition', $object->setManualTrigger(false)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\Transition', $object->setManualTrigger(false)); $this->assertFalse($object->hasManualTrigger()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide\\Transition', $object->setManualTrigger(null)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\Transition', $object->setManualTrigger(null)); $this->assertFalse($object->hasManualTrigger()); } @@ -59,23 +59,23 @@ public function testTimeTrigger() $object = new Transition(); $this->assertFalse($object->hasTimeTrigger()); $this->assertNull($object->getAdvanceTimeTrigger()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide\\Transition', $object->setTimeTrigger()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\Transition', $object->setTimeTrigger()); $this->assertFalse($object->hasTimeTrigger()); $this->assertNull($object->getAdvanceTimeTrigger()); $value = rand(1, 1000); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide\\Transition', $object->setTimeTrigger(true, $value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\Transition', $object->setTimeTrigger(true, $value)); $this->assertTrue($object->hasTimeTrigger()); $this->assertEquals($value, $object->getAdvanceTimeTrigger()); $value = rand(1, 1000); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide\\Transition', $object->setTimeTrigger(null, $value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\Transition', $object->setTimeTrigger(null, $value)); $this->assertTrue($object->hasTimeTrigger()); $this->assertEquals($value, $object->getAdvanceTimeTrigger()); $value = rand(1, 1000); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide\\Transition', $object->setTimeTrigger(false, $value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\Transition', $object->setTimeTrigger(false, $value)); $this->assertFalse($object->hasTimeTrigger()); $this->assertNull($object->getAdvanceTimeTrigger()); $value = rand(1, 1000); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide\\Transition', $object->setTimeTrigger(null, $value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\Transition', $object->setTimeTrigger(null, $value)); $this->assertFalse($object->hasTimeTrigger()); $this->assertNull($object->getAdvanceTimeTrigger()); } @@ -84,9 +84,9 @@ public function testTransitionType() { $object = new Transition(); $this->assertNull($object->getTransitionType()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide\\Transition', $object->setTransitionType()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\Transition', $object->setTransitionType()); $this->assertNull($object->getTransitionType()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide\\Transition', $object->setTransitionType(Transition::TRANSITION_RANDOM)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\Transition', $object->setTransitionType(Transition::TRANSITION_RANDOM)); $this->assertEquals(Transition::TRANSITION_RANDOM, $object->getTransitionType()); } diff --git a/tests/PhpPowerpoint/Tests/SlideTest.php b/tests/PhpPresentation/Tests/SlideTest.php similarity index 53% rename from tests/PhpPowerpoint/Tests/SlideTest.php rename to tests/PhpPresentation/Tests/SlideTest.php index 6dd0783bd..6b161ed25 100644 --- a/tests/PhpPowerpoint/Tests/SlideTest.php +++ b/tests/PhpPresentation/Tests/SlideTest.php @@ -1,30 +1,30 @@ assertNull($object->getParent()); - $oPhpPowerpoint = new PhpPowerpoint(); - $object = new Slide($oPhpPowerpoint); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\PhpPowerpoint', $object->getParent()); + $oPhpPresentation = new PhpPresentation(); + $object = new Slide($oPhpPresentation); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $object->getParent()); } public function testSlideLayout() { $object = new Slide(); $this->assertEquals(Slide\Layout::BLANK, $object->getSlideLayout()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide', $object->setSlideLayout()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide', $object->setSlideLayout()); $this->assertEquals(Slide\Layout::BLANK, $object->getSlideLayout()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide', $object->setSlideLayout(Slide\Layout::TITLE_SLIDE)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide', $object->setSlideLayout(Slide\Layout::TITLE_SLIDE)); $this->assertEquals(Slide\Layout::TITLE_SLIDE, $object->getSlideLayout()); } @@ -72,16 +72,16 @@ public function testSlideMasterId() $object = new Slide(); $this->assertEquals(1, $object->getSlideMasterId()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide', $object->setSlideMasterId()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide', $object->setSlideMasterId()); $this->assertEquals(1, $object->getSlideMasterId()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide', $object->setSlideMasterId($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide', $object->setSlideMasterId($value)); $this->assertEquals($value, $object->getSlideMasterId()); } public function testGroup() { $object = new Slide(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Shape\\Group', $object->createGroup()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Group', $object->createGroup()); } public function testTransition() @@ -89,11 +89,11 @@ public function testTransition() $object = new Slide(); $oTransition = new Transition(); $this->assertNull($object->getTransition()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide', $object->setTransition()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide', $object->setTransition()); $this->assertNull($object->getTransition()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide', $object->setTransition($oTransition)); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide\\Transition', $object->getTransition()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide', $object->setTransition(null)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide', $object->setTransition($oTransition)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\Transition', $object->getTransition()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide', $object->setTransition(null)); $this->assertNull($object->getTransition()); } } diff --git a/tests/PhpPowerpoint/Tests/Style/AlignmentTest.php b/tests/PhpPresentation/Tests/Style/AlignmentTest.php similarity index 64% rename from tests/PhpPowerpoint/Tests/Style/AlignmentTest.php rename to tests/PhpPresentation/Tests/Style/AlignmentTest.php index 36d574208..2996a5ffa 100644 --- a/tests/PhpPowerpoint/Tests/Style/AlignmentTest.php +++ b/tests/PhpPresentation/Tests/Style/AlignmentTest.php @@ -1,28 +1,28 @@ assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Alignment', $object->setHorizontal('')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->setHorizontal('')); $this->assertEquals(Alignment::HORIZONTAL_LEFT, $object->getHorizontal()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Alignment', $object->setHorizontal(Alignment::HORIZONTAL_GENERAL)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->setHorizontal(Alignment::HORIZONTAL_GENERAL)); $this->assertEquals(Alignment::HORIZONTAL_GENERAL, $object->getHorizontal()); } @@ -58,9 +58,9 @@ public function testSetGetHorizontal() public function testSetGetVertical() { $object = new Alignment(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Alignment', $object->setVertical('')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->setVertical('')); $this->assertEquals(Alignment::VERTICAL_BASE, $object->getVertical()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Alignment', $object->setVertical(Alignment::VERTICAL_AUTO)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->setVertical(Alignment::VERTICAL_AUTO)); $this->assertEquals(Alignment::VERTICAL_AUTO, $object->getVertical()); } @@ -91,7 +91,7 @@ public function testSetGetLevel() { $object = new Alignment(); $value = rand(1, 8); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Alignment', $object->setLevel($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->setLevel($value)); $this->assertEquals($value, $object->getLevel()); } @@ -104,18 +104,18 @@ public function testSetGetIndent() // != Alignment::HORIZONTAL_GENERAL $object->setHorizontal(Alignment::HORIZONTAL_CENTER); $value = rand(1, 100); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Alignment', $object->setIndent($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->setIndent($value)); $this->assertEquals(0, $object->getIndent()); $value = rand(-100, 0); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Alignment', $object->setIndent($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->setIndent($value)); $this->assertEquals($value, $object->getIndent()); $object->setHorizontal(Alignment::HORIZONTAL_GENERAL); $value = rand(1, 100); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Alignment', $object->setIndent($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->setIndent($value)); $this->assertEquals($value, $object->getIndent()); $value = rand(-100, 0); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Alignment', $object->setIndent($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->setIndent($value)); $this->assertEquals($value, $object->getIndent()); } @@ -128,18 +128,18 @@ public function testSetGetMarginLeft() // != Alignment::HORIZONTAL_GENERAL $object->setHorizontal(Alignment::HORIZONTAL_CENTER); $value = rand(1, 100); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Alignment', $object->setMarginLeft($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->setMarginLeft($value)); $this->assertEquals(0, $object->getMarginLeft()); $value = rand(-100, 0); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Alignment', $object->setMarginLeft($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->setMarginLeft($value)); $this->assertEquals($value, $object->getMarginLeft()); $object->setHorizontal(Alignment::HORIZONTAL_GENERAL); $value = rand(1, 100); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Alignment', $object->setMarginLeft($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->setMarginLeft($value)); $this->assertEquals($value, $object->getMarginLeft()); $value = rand(-100, 0); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Alignment', $object->setMarginLeft($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->setMarginLeft($value)); $this->assertEquals($value, $object->getMarginLeft()); } @@ -152,18 +152,18 @@ public function testSetGetMarginRight() // != Alignment::HORIZONTAL_GENERAL $object->setHorizontal(Alignment::HORIZONTAL_CENTER); $value = rand(1, 100); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Alignment', $object->setMarginRight($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->setMarginRight($value)); $this->assertEquals(0, $object->getMarginRight()); $value = rand(-100, 0); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Alignment', $object->setMarginRight($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->setMarginRight($value)); $this->assertEquals($value, $object->getMarginRight()); $object->setHorizontal(Alignment::HORIZONTAL_GENERAL); $value = rand(1, 100); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Alignment', $object->setMarginRight($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->setMarginRight($value)); $this->assertEquals($value, $object->getMarginRight()); $value = rand(-100, 0); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Alignment', $object->setMarginRight($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->setMarginRight($value)); $this->assertEquals($value, $object->getMarginRight()); } diff --git a/tests/PhpPowerpoint/Tests/Style/BorderTest.php b/tests/PhpPresentation/Tests/Style/BorderTest.php similarity index 55% rename from tests/PhpPowerpoint/Tests/Style/BorderTest.php rename to tests/PhpPresentation/Tests/Style/BorderTest.php index 73ba0ad4f..fb851dcd8 100644 --- a/tests/PhpPowerpoint/Tests/Style/BorderTest.php +++ b/tests/PhpPresentation/Tests/Style/BorderTest.php @@ -1,29 +1,29 @@ assertEquals(1, $object->getLineWidth()); $this->assertEquals(Border::LINE_SINGLE, $object->getLineStyle()); $this->assertEquals(Border::DASH_SOLID, $object->getDashStyle()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Color', $object->getColor()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Color', $object->getColor()); $this->assertEquals('FF000000', $object->getColor()->getARGB()); } @@ -46,10 +46,10 @@ public function testConstruct() public function testSetGetColor() { $object = new Border(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Border', $object->setColor()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Border', $object->setColor()); $this->assertNull($object->getColor()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Border', $object->setColor(new Color(COLOR::COLOR_BLUE))); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Color', $object->getColor()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Border', $object->setColor(new Color(COLOR::COLOR_BLUE))); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Color', $object->getColor()); $this->assertEquals('FF0000FF', $object->getColor()->getARGB()); } @@ -59,11 +59,11 @@ public function testSetGetColor() public function testSetGetDashStyle() { $object = new Border(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Border', $object->setDashStyle()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Border', $object->setDashStyle()); $this->assertEquals(Border::DASH_SOLID, $object->getDashStyle()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Border', $object->setDashStyle('')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Border', $object->setDashStyle('')); $this->assertEquals(Border::DASH_SOLID, $object->getDashStyle()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Border', $object->setDashStyle(BORDER::DASH_DASH)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Border', $object->setDashStyle(BORDER::DASH_DASH)); $this->assertEquals(Border::DASH_DASH, $object->getDashStyle()); } @@ -84,11 +84,11 @@ public function testSetGetHashIndex() public function testSetGetLineStyle() { $object = new Border(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Border', $object->setLineStyle()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Border', $object->setLineStyle()); $this->assertEquals(Border::LINE_SINGLE, $object->getLineStyle()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Border', $object->setLineStyle('')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Border', $object->setLineStyle('')); $this->assertEquals(Border::LINE_SINGLE, $object->getLineStyle()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Border', $object->setLineStyle(BORDER::LINE_DOUBLE)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Border', $object->setLineStyle(BORDER::LINE_DOUBLE)); $this->assertEquals(Border::LINE_DOUBLE, $object->getLineStyle()); } @@ -98,10 +98,10 @@ public function testSetGetLineStyle() public function testSetGetLineWidth() { $object = new Border(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Border', $object->setLineWidth()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Border', $object->setLineWidth()); $this->assertEquals(1, $object->getLineWidth()); $value = rand(1, 100); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Border', $object->setLineWidth($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Border', $object->setLineWidth($value)); $this->assertEquals($value, $object->getLineWidth()); } } diff --git a/tests/PhpPowerpoint/Tests/Style/BordersTest.php b/tests/PhpPresentation/Tests/Style/BordersTest.php similarity index 57% rename from tests/PhpPowerpoint/Tests/Style/BordersTest.php rename to tests/PhpPresentation/Tests/Style/BordersTest.php index 36672e562..2b4152c1a 100644 --- a/tests/PhpPowerpoint/Tests/Style/BordersTest.php +++ b/tests/PhpPresentation/Tests/Style/BordersTest.php @@ -1,29 +1,29 @@ assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Border', $object->getBottom()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Border', $object->getLeft()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Border', $object->getRight()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Border', $object->getTop()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Border', $object->getDiagonalDown()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Border', $object->getDiagonalUp()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Border', $object->getBottom()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Border', $object->getLeft()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Border', $object->getRight()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Border', $object->getTop()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Border', $object->getDiagonalDown()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Border', $object->getDiagonalUp()); $this->assertEquals(Border::LINE_NONE, $object->getDiagonalDown()->getLineStyle()); $this->assertEquals(Border::LINE_NONE, $object->getDiagonalUp()->getLineStyle()); } diff --git a/tests/PhpPowerpoint/Tests/Style/BulletTest.php b/tests/PhpPresentation/Tests/Style/BulletTest.php similarity index 60% rename from tests/PhpPowerpoint/Tests/Style/BulletTest.php rename to tests/PhpPresentation/Tests/Style/BulletTest.php index 2dd20de68..5fb0ccb72 100644 --- a/tests/PhpPowerpoint/Tests/Style/BulletTest.php +++ b/tests/PhpPresentation/Tests/Style/BulletTest.php @@ -1,28 +1,28 @@ assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Bullet', $object->setBulletChar()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Bullet', $object->setBulletChar()); $this->assertEquals('-', $object->getBulletChar()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Bullet', $object->setBulletChar('a')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Bullet', $object->setBulletChar('a')); $this->assertEquals('a', $object->getBulletChar()); } @@ -57,11 +57,11 @@ public function testSetGetBulletChar() public function testSetGetBulletFont() { $object = new Bullet(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Bullet', $object->setBulletFont()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Bullet', $object->setBulletFont()); $this->assertEquals('Calibri', $object->getBulletFont()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Bullet', $object->setBulletFont('')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Bullet', $object->setBulletFont('')); $this->assertEquals('Calibri', $object->getBulletFont()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Bullet', $object->setBulletFont('Arial')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Bullet', $object->setBulletFont('Arial')); $this->assertEquals('Arial', $object->getBulletFont()); } @@ -71,10 +71,10 @@ public function testSetGetBulletFont() public function testSetGetBulletNumericStartAt() { $object = new Bullet(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Bullet', $object->setBulletNumericStartAt()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Bullet', $object->setBulletNumericStartAt()); $this->assertEquals(1, $object->getBulletNumericStartAt()); $value = rand(1, 100); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Bullet', $object->setBulletNumericStartAt($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Bullet', $object->setBulletNumericStartAt($value)); $this->assertEquals($value, $object->getBulletNumericStartAt()); } @@ -84,9 +84,9 @@ public function testSetGetBulletNumericStartAt() public function testSetGetBulletNumericStyle() { $object = new Bullet(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Bullet', $object->setBulletNumericStyle()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Bullet', $object->setBulletNumericStyle()); $this->assertEquals(Bullet::NUMERIC_DEFAULT, $object->getBulletNumericStyle()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Bullet', $object->setBulletNumericStyle(Bullet::NUMERIC_ALPHALCPARENBOTH)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Bullet', $object->setBulletNumericStyle(Bullet::NUMERIC_ALPHALCPARENBOTH)); $this->assertEquals(Bullet::NUMERIC_ALPHALCPARENBOTH, $object->getBulletNumericStyle()); } @@ -96,9 +96,9 @@ public function testSetGetBulletNumericStyle() public function testSetGetBulletType() { $object = new Bullet(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Bullet', $object->setBulletType()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Bullet', $object->setBulletType()); $this->assertEquals(Bullet::TYPE_NONE, $object->getBulletType()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Bullet', $object->setBulletType(Bullet::TYPE_BULLET)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Bullet', $object->setBulletType(Bullet::TYPE_BULLET)); $this->assertEquals(Bullet::TYPE_BULLET, $object->getBulletType()); } diff --git a/tests/PhpPowerpoint/Tests/Style/ColorTest.php b/tests/PhpPresentation/Tests/Style/ColorTest.php similarity index 60% rename from tests/PhpPowerpoint/Tests/Style/ColorTest.php rename to tests/PhpPresentation/Tests/Style/ColorTest.php index 3025994d1..c38b35204 100644 --- a/tests/PhpPowerpoint/Tests/Style/ColorTest.php +++ b/tests/PhpPresentation/Tests/Style/ColorTest.php @@ -1,28 +1,28 @@ assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Color', $object->setARGB()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Color', $object->setARGB()); $this->assertEquals(Color::COLOR_BLACK, $object->getARGB()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Color', $object->setARGB('')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Color', $object->setARGB('')); $this->assertEquals(Color::COLOR_BLACK, $object->getARGB()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Color', $object->setARGB(Color::COLOR_BLUE)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Color', $object->setARGB(Color::COLOR_BLUE)); $this->assertEquals(Color::COLOR_BLUE, $object->getARGB()); } @@ -57,16 +57,16 @@ public function testSetGetARGB() public function testSetGetRGB() { $object = new Color(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Color', $object->setRGB()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Color', $object->setRGB()); $this->assertEquals('000000', $object->getRGB()); $this->assertEquals('FF000000', $object->getARGB()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Color', $object->setRGB('')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Color', $object->setRGB('')); $this->assertEquals('000000', $object->getRGB()); $this->assertEquals('FF000000', $object->getARGB()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Color', $object->setRGB('555')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Color', $object->setRGB('555')); $this->assertEquals('555', $object->getRGB()); $this->assertEquals('FF555', $object->getARGB()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Color', $object->setRGB('6666')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Color', $object->setRGB('6666')); $this->assertEquals('FF6666', $object->getRGB()); $this->assertEquals('FF6666', $object->getARGB()); } diff --git a/tests/PhpPowerpoint/Tests/Style/FillTest.php b/tests/PhpPresentation/Tests/Style/FillTest.php similarity index 53% rename from tests/PhpPowerpoint/Tests/Style/FillTest.php rename to tests/PhpPresentation/Tests/Style/FillTest.php index 338720a0e..bf2976aec 100644 --- a/tests/PhpPowerpoint/Tests/Style/FillTest.php +++ b/tests/PhpPresentation/Tests/Style/FillTest.php @@ -1,29 +1,29 @@ assertEquals(Fill::FILL_NONE, $object->getFillType()); $this->assertEquals(0, $object->getRotation()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Color', $object->getStartColor()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Color', $object->getStartColor()); $this->assertEquals(Color::COLOR_WHITE, $object->getStartColor()->getARGB()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Color', $object->getEndColor()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Color', $object->getEndColor()); $this->assertEquals(Color::COLOR_BLACK, $object->getEndColor()->getARGB()); } @@ -47,10 +47,10 @@ public function testConstruct() public function testSetGetEndColor() { $object = new Fill(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Fill', $object->setEndColor()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Fill', $object->setEndColor()); $this->assertNull($object->getEndColor()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Fill', $object->setEndColor(new Color(COLOR::COLOR_BLUE))); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Color', $object->getEndColor()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Fill', $object->setEndColor(new Color(COLOR::COLOR_BLUE))); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Color', $object->getEndColor()); $this->assertEquals(COLOR::COLOR_BLUE, $object->getEndColor()->getARGB()); } @@ -60,9 +60,9 @@ public function testSetGetEndColor() public function testSetGetFillType() { $object = new Fill(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Fill', $object->setFillType()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Fill', $object->setFillType()); $this->assertEquals(Fill::FILL_NONE, $object->getFillType()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Fill', $object->setFillType(Fill::FILL_GRADIENT_LINEAR)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Fill', $object->setFillType(Fill::FILL_GRADIENT_LINEAR)); $this->assertEquals(Fill::FILL_GRADIENT_LINEAR, $object->getFillType()); } @@ -72,10 +72,10 @@ public function testSetGetFillType() public function testSetGetRotation() { $object = new Fill(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Fill', $object->setRotation()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Fill', $object->setRotation()); $this->assertEquals(0, $object->getRotation()); $value = rand(1, 100); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Fill', $object->setRotation($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Fill', $object->setRotation($value)); $this->assertEquals($value, $object->getRotation()); } @@ -85,10 +85,10 @@ public function testSetGetRotation() public function testSetGetStartColor() { $object = new Fill(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Fill', $object->setStartColor()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Fill', $object->setStartColor()); $this->assertNull($object->getStartColor()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Fill', $object->setStartColor(new Color(COLOR::COLOR_BLUE))); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Color', $object->getStartColor()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Fill', $object->setStartColor(new Color(COLOR::COLOR_BLUE))); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Color', $object->getStartColor()); $this->assertEquals(COLOR::COLOR_BLUE, $object->getStartColor()->getARGB()); } diff --git a/tests/PhpPowerpoint/Tests/Style/FontTest.php b/tests/PhpPresentation/Tests/Style/FontTest.php similarity index 53% rename from tests/PhpPowerpoint/Tests/Style/FontTest.php rename to tests/PhpPresentation/Tests/Style/FontTest.php index f835786d8..9da614fdc 100644 --- a/tests/PhpPowerpoint/Tests/Style/FontTest.php +++ b/tests/PhpPresentation/Tests/Style/FontTest.php @@ -1,29 +1,29 @@ assertFalse($object->isSubScript()); $this->assertFalse($object->isStrikethrough()); $this->assertEquals(Font::UNDERLINE_NONE, $object->getUnderline()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Color', $object->getColor()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Color', $object->getColor()); $this->assertEquals(Color::COLOR_BLACK, $object->getColor()->getARGB()); } @@ -51,10 +51,10 @@ public function testConstruct() public function testSetGetColor() { $object = new Font(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setColor()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setColor()); $this->assertNull($object->getColor()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setColor(new Color(Color::COLOR_BLUE))); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Color', $object->getColor()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setColor(new Color(Color::COLOR_BLUE))); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Color', $object->getColor()); $this->assertEquals(Color::COLOR_BLUE, $object->getColor()->getARGB()); } @@ -64,11 +64,11 @@ public function testSetGetColor() public function testSetGetName() { $object = new Font(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setName()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setName()); $this->assertEquals('Calibri', $object->getName()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setName('')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setName('')); $this->assertEquals('Calibri', $object->getName()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setName('Arial')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setName('Arial')); $this->assertEquals('Arial', $object->getName()); } @@ -78,12 +78,12 @@ public function testSetGetName() public function testSetGetSize() { $object = new Font(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setSize()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setSize()); $this->assertEquals(10, $object->getSize()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setSize('')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setSize('')); $this->assertEquals(10, $object->getSize()); $value = rand(1, 100); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setSize($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setSize($value)); $this->assertEquals($value, $object->getSize()); } @@ -93,11 +93,11 @@ public function testSetGetSize() public function testSetGetUnderline() { $object = new Font(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setUnderline()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setUnderline()); $this->assertEquals(FONT::UNDERLINE_NONE, $object->getUnderline()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setUnderline('')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setUnderline('')); $this->assertEquals(FONT::UNDERLINE_NONE, $object->getUnderline()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setUnderline(FONT::UNDERLINE_DASH)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setUnderline(FONT::UNDERLINE_DASH)); $this->assertEquals(FONT::UNDERLINE_DASH, $object->getUnderline()); } @@ -107,13 +107,13 @@ public function testSetGetUnderline() public function testSetIsBold() { $object = new Font(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setBold()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setBold()); $this->assertFalse($object->isBold()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setBold('')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setBold('')); $this->assertFalse($object->isBold()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setBold(false)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setBold(false)); $this->assertFalse($object->isBold()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setBold(true)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setBold(true)); $this->assertTrue($object->isBold()); } @@ -123,13 +123,13 @@ public function testSetIsBold() public function testSetIsItalic() { $object = new Font(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setItalic()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setItalic()); $this->assertFalse($object->isItalic()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setItalic('')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setItalic('')); $this->assertFalse($object->isItalic()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setItalic(false)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setItalic(false)); $this->assertFalse($object->isItalic()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setItalic(true)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setItalic(true)); $this->assertTrue($object->isItalic()); } @@ -139,13 +139,13 @@ public function testSetIsItalic() public function testSetIsStriketrough() { $object = new Font(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setStrikethrough()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setStrikethrough()); $this->assertFalse($object->isStrikethrough()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setStrikethrough('')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setStrikethrough('')); $this->assertFalse($object->isStrikethrough()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setStrikethrough(false)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setStrikethrough(false)); $this->assertFalse($object->isStrikethrough()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setStrikethrough(true)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setStrikethrough(true)); $this->assertTrue($object->isStrikethrough()); } @@ -155,16 +155,16 @@ public function testSetIsStriketrough() public function testSetIsSubScript() { $object = new Font(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setSubScript()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setSubScript()); $this->assertFalse($object->isSubScript()); $this->assertTrue($object->isSuperScript()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setSubScript('')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setSubScript('')); $this->assertFalse($object->isSubScript()); $this->assertTrue($object->isSuperScript()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setSubScript(false)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setSubScript(false)); $this->assertFalse($object->isSubScript()); $this->assertTrue($object->isSuperScript()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setSubScript(true)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setSubScript(true)); $this->assertTrue($object->isSubScript()); $this->assertFalse($object->isSuperScript()); } @@ -175,16 +175,16 @@ public function testSetIsSubScript() public function testSetIsSuperScript() { $object = new Font(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setSuperScript()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setSuperScript()); $this->assertFalse($object->isSuperScript()); $this->assertTrue($object->isSubScript()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setSuperScript('')); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setSuperScript('')); $this->assertFalse($object->isSuperScript()); $this->assertTrue($object->isSubScript()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setSuperScript(false)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setSuperScript(false)); $this->assertFalse($object->isSuperScript()); $this->assertTrue($object->isSubScript()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setSuperScript(true)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->setSuperScript(true)); $this->assertTrue($object->isSuperScript()); $this->assertFalse($object->isSubScript()); } diff --git a/tests/PhpPowerpoint/Tests/Style/ShadowTest.php b/tests/PhpPresentation/Tests/Style/ShadowTest.php similarity index 57% rename from tests/PhpPowerpoint/Tests/Style/ShadowTest.php rename to tests/PhpPresentation/Tests/Style/ShadowTest.php index cc0871af4..78bfae9b1 100644 --- a/tests/PhpPowerpoint/Tests/Style/ShadowTest.php +++ b/tests/PhpPresentation/Tests/Style/ShadowTest.php @@ -1,29 +1,29 @@ assertEquals(2, $object->getDistance()); $this->assertEquals(0, $object->getDirection()); $this->assertEquals(Shadow::SHADOW_BOTTOM_RIGHT, $object->getAlignment()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Color', $object->getColor()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Color', $object->getColor()); $this->assertEquals(Color::COLOR_BLACK, $object->getColor()->getARGB()); $this->assertEquals(50, $object->getAlpha()); } @@ -49,9 +49,9 @@ public function testConstruct() public function testSetGetAlignment() { $object = new Shadow(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Shadow', $object->setAlignment()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Shadow', $object->setAlignment()); $this->assertEquals(Shadow::SHADOW_BOTTOM_RIGHT, $object->getAlignment()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Shadow', $object->setAlignment(Shadow::SHADOW_CENTER)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Shadow', $object->setAlignment(Shadow::SHADOW_CENTER)); $this->assertEquals(Shadow::SHADOW_CENTER, $object->getAlignment()); } @@ -61,10 +61,10 @@ public function testSetGetAlignment() public function testSetGetAlpha() { $object = new Shadow(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Shadow', $object->setAlpha()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Shadow', $object->setAlpha()); $this->assertEquals(0, $object->getAlpha()); $value = rand(1, 100); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Shadow', $object->setAlpha($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Shadow', $object->setAlpha($value)); $this->assertEquals($value, $object->getAlpha()); } @@ -74,10 +74,10 @@ public function testSetGetAlpha() public function testSetGetBlurRadius() { $object = new Shadow(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Shadow', $object->setBlurRadius()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Shadow', $object->setBlurRadius()); $this->assertEquals(6, $object->getBlurRadius()); $value = rand(1, 100); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Shadow', $object->setBlurRadius($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Shadow', $object->setBlurRadius($value)); $this->assertEquals($value, $object->getBlurRadius()); } @@ -87,10 +87,10 @@ public function testSetGetBlurRadius() public function testSetGetColor() { $object = new Shadow(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Shadow', $object->setColor()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Shadow', $object->setColor()); $this->assertNull($object->getColor()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Shadow', $object->setColor(new Color(Color::COLOR_BLUE))); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Color', $object->getColor()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Shadow', $object->setColor(new Color(Color::COLOR_BLUE))); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Color', $object->getColor()); $this->assertEquals(Color::COLOR_BLUE, $object->getColor()->getARGB()); } @@ -100,10 +100,10 @@ public function testSetGetColor() public function testSetGetDirection() { $object = new Shadow(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Shadow', $object->setDirection()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Shadow', $object->setDirection()); $this->assertEquals(0, $object->getDirection()); $value = rand(1, 100); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Shadow', $object->setDirection($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Shadow', $object->setDirection($value)); $this->assertEquals($value, $object->getDirection()); } @@ -113,10 +113,10 @@ public function testSetGetDirection() public function testSetGetDistance() { $object = new Shadow(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Shadow', $object->setDistance()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Shadow', $object->setDistance()); $this->assertEquals(2, $object->getDistance()); $value = rand(1, 100); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Shadow', $object->setDistance($value)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Shadow', $object->setDistance($value)); $this->assertEquals($value, $object->getDistance()); } @@ -137,11 +137,11 @@ public function testSetGetHashIndex() public function testSetIsVisible() { $object = new Shadow(); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Shadow', $object->setVisible()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Shadow', $object->setVisible()); $this->assertFalse($object->isVisible()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Shadow', $object->setVisible(false)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Shadow', $object->setVisible(false)); $this->assertFalse($object->isVisible()); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Shadow', $object->setVisible(true)); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Shadow', $object->setVisible(true)); $this->assertTrue($object->isVisible()); } } diff --git a/tests/PhpPowerpoint/Tests/Writer/ODPresentation/AbstractPartTest.php b/tests/PhpPresentation/Tests/Writer/ODPresentation/AbstractPartTest.php similarity index 64% rename from tests/PhpPowerpoint/Tests/Writer/ODPresentation/AbstractPartTest.php rename to tests/PhpPresentation/Tests/Writer/ODPresentation/AbstractPartTest.php index c0f9ca7d0..c0c353c3c 100644 --- a/tests/PhpPowerpoint/Tests/Writer/ODPresentation/AbstractPartTest.php +++ b/tests/PhpPresentation/Tests/Writer/ODPresentation/AbstractPartTest.php @@ -1,33 +1,33 @@ addSeries($oSeries); - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $oChart = $oSlide->createChartShape(); $oChart->getPlotArea()->setType($oArea); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $element = '/office:document-content/office:body/office:chart/chart:chart'; $this->assertTrue($pres->elementExists($element, 'Object 1/content.xml')); diff --git a/tests/PhpPowerpoint/Tests/Writer/ODPresentation/ChartBarTest.php b/tests/PhpPresentation/Tests/Writer/ODPresentation/ChartBarTest.php similarity index 75% rename from tests/PhpPowerpoint/Tests/Writer/ODPresentation/ChartBarTest.php rename to tests/PhpPresentation/Tests/Writer/ODPresentation/ChartBarTest.php index 43cec308e..e4221b00b 100644 --- a/tests/PhpPowerpoint/Tests/Writer/ODPresentation/ChartBarTest.php +++ b/tests/PhpPresentation/Tests/Writer/ODPresentation/ChartBarTest.php @@ -1,34 +1,34 @@ addSeries($oSeries); - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $oChart = $oSlide->createChartShape(); $oChart->getPlotArea()->setType($oBar); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $element = '/office:document-content/office:body/office:chart/chart:chart'; $this->assertTrue($pres->elementExists($element, 'Object 1/content.xml')); @@ -84,12 +84,12 @@ public function testChartBarHorizontal() $oBar->setBarDirection(Bar::DIRECTION_HORIZONTAL); $oBar->addSeries($oSeries); - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $oChart = $oSlide->createChartShape(); $oChart->getPlotArea()->setType($oBar); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $element = '/office:document-content/office:body/office:chart/chart:chart'; $this->assertTrue($pres->elementExists($element, 'Object 1/content.xml')); diff --git a/tests/PhpPowerpoint/Tests/Writer/ODPresentation/ChartsTest.php b/tests/PhpPresentation/Tests/Writer/ODPresentation/ChartsTest.php similarity index 81% rename from tests/PhpPowerpoint/Tests/Writer/ODPresentation/ChartsTest.php rename to tests/PhpPresentation/Tests/Writer/ODPresentation/ChartsTest.php index 9fc5e55ff..6d6d881d7 100644 --- a/tests/PhpPowerpoint/Tests/Writer/ODPresentation/ChartsTest.php +++ b/tests/PhpPresentation/Tests/Writer/ODPresentation/ChartsTest.php @@ -1,38 +1,38 @@ getMockForAbstractClass('PhpOffice\PhpPowerpoint\Shape\Chart\Type\AbstractType'); + $oStub = $this->getMockForAbstractClass('PhpOffice\PhpPresentation\Shape\Chart\Type\AbstractType'); - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $oChart = $oSlide->createChartShape(); $oChart->getPlotArea()->setType($oStub); - TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); } public function testTitleVisibility() { - $oPHPPowerPoint = new PhpPowerpoint(); - $oSlide = $oPHPPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createChartShape(); $oLine = new Line(); $oShape->getPlotArea()->setType($oLine); @@ -73,13 +73,13 @@ public function testTitleVisibility() $elementStyle = '/office:document-content/office:automatic-styles/style:style[@style:name=\'styleTitle\']'; $this->assertTrue($oShape->getTitle()->isVisible()); - $this->assertInstanceOf('PhpOffice\PhpPowerpoint\Shape\Chart\Title', $oShape->getTitle()->setVisible(true)); - $oXMLDoc = TestHelperDOCX::getDocument($oPHPPowerPoint, 'ODPresentation'); + $this->assertInstanceOf('PhpOffice\PhpPresentation\Shape\Chart\Title', $oShape->getTitle()->setVisible(true)); + $oXMLDoc = TestHelperDOCX::getDocument($oPhpPresentation, 'ODPresentation'); $this->assertTrue($oXMLDoc->elementExists($elementTitle, 'Object 1/content.xml')); $this->assertTrue($oXMLDoc->elementExists($elementStyle, 'Object 1/content.xml')); - $this->assertInstanceOf('PhpOffice\PhpPowerpoint\Shape\Chart\Title', $oShape->getTitle()->setVisible(false)); - $oXMLDoc = TestHelperDOCX::getDocument($oPHPPowerPoint, 'ODPresentation'); + $this->assertInstanceOf('PhpOffice\PhpPresentation\Shape\Chart\Title', $oShape->getTitle()->setVisible(false)); + $oXMLDoc = TestHelperDOCX::getDocument($oPhpPresentation, 'ODPresentation'); $this->assertFalse($oXMLDoc->elementExists($elementTitle, 'Object 1/content.xml')); $this->assertFalse($oXMLDoc->elementExists($elementStyle, 'Object 1/content.xml')); } @@ -95,12 +95,12 @@ public function testChartBar3D() $oBar3D = new Bar3D(); $oBar3D->addSeries($oSeries); - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $oChart = $oSlide->createChartShape(); $oChart->getPlotArea()->setType($oBar3D); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $element = '/office:document-content/office:body/office:chart/chart:chart'; $this->assertTrue($pres->elementExists($element, 'Object 1/content.xml')); @@ -130,12 +130,12 @@ public function testChartBar3DHorizontal() $oBar3D->setBarDirection(Bar3D::DIRECTION_HORIZONTAL); $oBar3D->addSeries($oSeries); - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $oChart = $oSlide->createChartShape(); $oChart->getPlotArea()->setType($oBar3D); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $element = '/office:document-content/office:body/office:chart/chart:chart'; $this->assertTrue($pres->elementExists($element, 'Object 1/content.xml')); @@ -158,12 +158,12 @@ public function testChartLine() $oLine = new Line(); $oLine->addSeries($oSeries); - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $oChart = $oSlide->createChartShape(); $oChart->getPlotArea()->setType($oLine); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $element = '/office:document-content/office:body/office:chart/chart:chart'; $this->assertTrue($pres->elementExists($element, 'Object 1/content.xml')); @@ -197,12 +197,12 @@ public function testChartPie() $oPie = new Pie(); $oPie->addSeries($oSeries); - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $oChart = $oSlide->createChartShape(); $oChart->getPlotArea()->setType($oPie); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $element = '/office:document-content/office:body/office:chart/chart:chart'; $this->assertTrue($pres->elementExists($element, 'Object 1/content.xml')); @@ -231,12 +231,12 @@ public function testChartPie3D() $oPie3D = new Pie3D(); $oPie3D->addSeries($oSeries); - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $oChart = $oSlide->createChartShape(); $oChart->getPlotArea()->setType($oPie3D); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $element = '/office:document-content/office:body/office:chart/chart:chart'; $this->assertTrue($pres->elementExists($element, 'Object 1/content.xml')); @@ -265,12 +265,12 @@ public function testChartPie3DExplosion() $oPie3D->setExplosion($value); $oPie3D->addSeries($oSeries); - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $oChart = $oSlide->createChartShape(); $oChart->getPlotArea()->setType($oPie3D); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $element = '/office:document-content/office:automatic-styles/style:style[@style:name=\'styleSeries0\'][@style:family=\'chart\']/style:chart-properties'; $this->assertTrue($pres->elementExists($element, 'Object 1/content.xml')); @@ -285,12 +285,12 @@ public function testChartScatter() $oScatter = new Scatter(); $oScatter->addSeries($oSeries); - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $oChart = $oSlide->createChartShape(); $oChart->getPlotArea()->setType($oScatter); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $element = '/office:document-content/office:body/office:chart/chart:chart'; $this->assertTrue($pres->elementExists($element, 'Object 1/content.xml')); @@ -305,12 +305,12 @@ public function testLegend() $oLine = new Line(); $oLine->addSeries($oSeries); - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $oChart = $oSlide->createChartShape(); $oChart->getPlotArea()->setType($oLine); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $element = '/office:document-content/office:body/office:chart/chart:chart/chart:legend'; $this->assertTrue($pres->elementExists($element, 'Object 1/content.xml')); diff --git a/tests/PhpPowerpoint/Tests/Writer/ODPresentation/ContentTest.php b/tests/PhpPresentation/Tests/Writer/ODPresentation/ContentTest.php similarity index 85% rename from tests/PhpPowerpoint/Tests/Writer/ODPresentation/ContentTest.php rename to tests/PhpPresentation/Tests/Writer/ODPresentation/ContentTest.php index 4af9d7aca..0fb9ffab5 100644 --- a/tests/PhpPowerpoint/Tests/Writer/ODPresentation/ContentTest.php +++ b/tests/PhpPresentation/Tests/Writer/ODPresentation/ContentTest.php @@ -1,40 +1,40 @@ getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $oShape = $oSlide->createDrawingShape(); - $oShape->setPath(PHPPOWERPOINT_TESTS_BASE_DIR.'/resources/images/PHPPowerPointLogo.png'); - $oShape->getHyperlink()->setUrl('https://github.com/PHPOffice/PHPPowerPoint/'); + $oShape->setPath(PHPPRESENTATION_TESTS_BASE_DIR.'/resources/images/PhpPresentationLogo.png'); + $oShape->getHyperlink()->setUrl('https://github.com/PHPOffice/PHPPresentation/'); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $element = '/office:document-content/office:body/office:presentation/draw:page/draw:frame/office:event-listeners/presentation:event-listener'; $this->assertTrue($pres->elementExists($element, 'content.xml')); - $this->assertEquals('https://github.com/PHPOffice/PHPPowerPoint/', $pres->getElementAttribute($element, 'xlink:href', 'content.xml')); + $this->assertEquals('https://github.com/PHPOffice/PHPPresentation/', $pres->getElementAttribute($element, 'xlink:href', 'content.xml')); } public function testGroup() { - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $oShapeGroup = $oSlide->createGroup(); $oShape = $oShapeGroup->createDrawingShape(); - $oShape->setPath(PHPPOWERPOINT_TESTS_BASE_DIR.'/resources/images/PHPPowerPointLogo.png'); - $oShape->getHyperlink()->setUrl('https://github.com/PHPOffice/PHPPowerPoint/'); + $oShape->setPath(PHPPRESENTATION_TESTS_BASE_DIR.'/resources/images/PhpPresentationLogo.png'); + $oShape->getHyperlink()->setUrl('https://github.com/PHPOffice/PHPPresentation/'); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $element = '/office:document-content/office:body/office:presentation/draw:page/draw:g'; $this->assertTrue($pres->elementExists($element, 'content.xml')); @@ -80,8 +80,8 @@ public function testGroup() public function testList() { - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRichText->getActiveParagraph()->getBulletStyle()->setBulletType(Bullet::TYPE_BULLET); $oRichText->createTextRun('Alpha'); @@ -89,7 +89,7 @@ public function testList() $oRichText->createParagraph()->createTextRun('Delta'); $oRichText->createParagraph()->createTextRun('Epsilon'); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $element = '/office:document-content/office:automatic-styles/text:list-style/text:list-level-style-bullet'; $this->assertTrue($pres->elementExists($element, 'content.xml')); @@ -103,8 +103,8 @@ public function testList() public function testInnerList() { - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRichText->getActiveParagraph()->getAlignment()->setHorizontal(Alignment::HORIZONTAL_LEFT)->setMarginLeft(25)->setIndent(-25); @@ -123,7 +123,7 @@ public function testInnerList() $oRichText->createParagraph()->createTextRun('Beta.Beta'); $oRichText->createParagraph()->createTextRun('Beta.Delta'); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $element = '/office:document-content/office:automatic-styles/text:list-style/text:list-level-style-bullet'; $this->assertTrue($pres->elementExists($element, 'content.xml')); @@ -137,8 +137,8 @@ public function testInnerList() public function testParagraphRichText() { - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRichText->createTextRun('Alpha'); $oRichText->createBreak(); @@ -147,7 +147,7 @@ public function testParagraphRichText() $oRun = $oRichText->createTextRun('Delta'); $oRun->getHyperlink()->setUrl('http://www.google.fr'); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $element = '/office:document-content/office:body/office:presentation/draw:page/draw:frame/draw:text-box/text:p/text:span/text:line-break'; $this->assertTrue($pres->elementExists($element, 'content.xml')); @@ -159,8 +159,8 @@ public function testParagraphRichText() public function testListWithRichText() { - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRichText->getActiveParagraph()->getBulletStyle()->setBulletType(Bullet::TYPE_BULLET); $oRun = $oRichText->createTextRun('Alpha'); @@ -168,7 +168,7 @@ public function testListWithRichText() $oRichText->createBreak(); $oRichText->createTextRun('Beta'); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $element = '/office:document-content/office:body/office:presentation/draw:page/draw:frame/draw:text-box/text:list/text:list-item/text:p/text:span/text:a'; $this->assertTrue($pres->elementExists($element, 'content.xml')); @@ -178,13 +178,13 @@ public function testListWithRichText() public function testNote() { - $oPHPPowerPoint = new PhpPowerpoint(); - $oSlide = $oPHPPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oNote = $oSlide->getNote(); $oRichText = $oNote->createRichTextShape()->setHeight(300)->setWidth(600); $oRichText->createTextRun('testNote'); - $pres = TestHelperDOCX::getDocument($oPHPPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'ODPresentation'); $element = '/office:document-content/office:body/office:presentation/draw:page/presentation:notes'; $this->assertTrue($pres->elementExists($element, 'content.xml')); $element = '/office:document-content/office:body/office:presentation/draw:page/presentation:notes/draw:frame/draw:text-box/text:p/text:span'; @@ -193,18 +193,18 @@ public function testNote() public function testRichTextAutoShrink() { - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $oRichText1 = $oSlide->createRichTextShape(); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $element = '/office:document-content/office:automatic-styles/style:style[@style:name=\'gr1\']/style:graphic-properties'; $this->assertFalse($pres->attributeElementExists($element, 'draw:auto-grow-height', 'content.xml')); $this->assertFalse($pres->attributeElementExists($element, 'draw:auto-grow-width', 'content.xml')); $oRichText1->setAutoShrinkHorizontal(false); $oRichText1->setAutoShrinkVertical(true); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $element = '/office:document-content/office:automatic-styles/style:style[@style:name=\'gr1\']/style:graphic-properties'; $this->assertTrue($pres->attributeElementExists($element, 'draw:auto-grow-height', 'content.xml')); $this->assertTrue($pres->attributeElementExists($element, 'draw:auto-grow-width', 'content.xml')); @@ -214,7 +214,7 @@ public function testRichTextAutoShrink() $oRichText1->setAutoShrinkHorizontal(true); $oRichText1->setAutoShrinkVertical(false); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $element = '/office:document-content/office:automatic-styles/style:style[@style:name=\'gr1\']/style:graphic-properties'; $this->assertTrue($pres->attributeElementExists($element, 'draw:auto-grow-height', 'content.xml')); $this->assertTrue($pres->attributeElementExists($element, 'draw:auto-grow-width', 'content.xml')); @@ -224,14 +224,14 @@ public function testRichTextAutoShrink() public function testRichTextBorder() { - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $oRichText1 = $oSlide->createRichTextShape(); $element = '/office:document-content/office:automatic-styles/style:style[@style:name=\'gr1\']/style:graphic-properties'; $oRichText1->getBorder()->setColor(new Color('FF4672A8'))->setDashStyle(Border::DASH_SOLID)->setLineStyle(Border::LINE_NONE); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $this->assertTrue($pres->elementExists($element, 'content.xml')); $this->assertFalse($pres->attributeElementExists($element, 'svg:stroke-color', 'content.xml')); $this->assertFalse($pres->attributeElementExists($element, 'svg:stroke-width', 'content.xml')); @@ -239,7 +239,7 @@ public function testRichTextBorder() $this->assertEquals('none', $pres->getElementAttribute($element, 'draw:stroke', 'content.xml')); $oRichText1->getBorder()->setColor(new Color('FF4672A8'))->setDashStyle(Border::DASH_SOLID)->setLineStyle(Border::LINE_SINGLE); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $this->assertTrue($pres->elementExists($element, 'content.xml')); $this->assertTrue($pres->attributeElementExists($element, 'svg:stroke-color', 'content.xml')); $this->assertEquals('#'.$oRichText1->getBorder()->getColor()->getRGB(), $pres->getElementAttribute($element, 'svg:stroke-color', 'content.xml')); @@ -251,7 +251,7 @@ public function testRichTextBorder() $this->assertFalse($pres->attributeElementExists($element, 'draw:stroke-dash', 'content.xml')); $oRichText1->getBorder()->setColor(new Color('FF4672A8'))->setDashStyle(Border::DASH_DASH); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $element = '/office:document-content/office:automatic-styles/style:style[@style:name=\'gr1\']/style:graphic-properties'; $this->assertEquals('dash', $pres->getElementAttribute($element, 'draw:stroke', 'content.xml')); $this->assertTrue($pres->attributeElementExists($element, 'draw:stroke-dash', 'content.xml')); @@ -262,8 +262,8 @@ public function testRichTextBorder() public function testRichTextShadow() { $randAlpha = rand(0, 100); - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRichText->createTextRun('AAA'); $oRichText->getShadow()->setVisible(true)->setAlpha($randAlpha)->setBlurRadius(2); @@ -272,7 +272,7 @@ public function testRichTextShadow() for ($inc = 0; $inc <= 360; $inc += 45) { $randDistance = rand(0, 100); $oRichText->getShadow()->setDirection($inc)->setDistance($randDistance); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $this->assertTrue($pres->elementExists($element, 'content.xml')); $this->assertEquals('visible', $pres->getElementAttribute($element, 'draw:shadow', 'content.xml')); $this->assertEquals('none', $pres->getElementAttribute($element, 'style:mirror', 'content.xml')); @@ -308,8 +308,8 @@ public function testRichTextShadow() public function testStyleAlignment() { - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $oRichText1 = $oSlide->createRichTextShape(); $oRichText1->getActiveParagraph()->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER); $oRichText1->createTextRun('Run1'); @@ -340,7 +340,7 @@ public function testStyleAlignment() $oRichText6->createTextRun('Run6'); $p6HashCode = $oRichText6->getActiveParagraph()->getHashCode(); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $element = '/office:document-content/office:automatic-styles/style:style[@style:name=\'P_'.$p1HashCode.'\']/style:paragraph-properties'; $this->assertTrue($pres->elementExists($element, 'content.xml')); @@ -369,15 +369,15 @@ public function testStyleAlignment() public function testStyleFont() { - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRun = $oRichText->createTextRun('Run1'); $oRun->getFont()->setBold(true); $expectedHashCode = $oRun->getFont()->getHashCode(); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $element = '/office:document-content/office:automatic-styles/style:style[@style:name=\'T_'.$expectedHashCode.'\']/style:text-properties'; $this->assertTrue($pres->elementExists($element, 'content.xml')); @@ -386,11 +386,11 @@ public function testStyleFont() public function testTable() { - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $oSlide->createTableShape(); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $element = '/office:document-content/office:body/office:presentation/draw:page/draw:frame/table:table'; $this->assertTrue($pres->elementExists($element, 'content.xml')); } @@ -403,14 +403,14 @@ public function testTableCellFill() $oFill = new Fill(); $oFill->setFillType(Fill::FILL_SOLID)->setStartColor($oColor); - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $oShape = $oSlide->createTableShape(); $oRow = $oShape->createRow(); $oCell = $oRow->getCell(); $oCell->setFill($oFill); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $element = '/office:document-content/office:automatic-styles/style:style[@style:name=\'gr1r0c0\']'; $this->assertTrue($pres->elementExists($element, 'content.xml')); $this->assertEquals('table-cell', $pres->getElementAttribute($element, 'style:family', 'content.xml')); @@ -425,39 +425,39 @@ public function testTableWithColspan() { $value = rand(2, 100); - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $oShape = $oSlide->createTableShape($value); $oRow = $oShape->createRow(); $oCell = $oRow->getCell(); $oCell->setColSpan($value); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $element = '/office:document-content/office:body/office:presentation/draw:page/draw:frame/table:table/table:table-row/table:table-cell'; $this->assertTrue($pres->elementExists($element, 'content.xml')); $this->assertEquals($value, $pres->getElementAttribute($element, 'table:number-columns-spanned', 'content.xml')); } /** - * @link : https://github.com/PHPOffice/PHPPowerPoint/issues/70 + * @link : https://github.com/PHPOffice/PHPPresentation/issues/70 */ public function testTableWithHyperlink() { - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $oShape = $oSlide->createTableShape(4); $oShape->setHeight(200)->setWidth(600)->setOffsetX(150)->setOffsetY(300); $oRow = $oShape->createRow(); $oCell = $oRow->getCell(); $oTextRun = $oCell->createTextRun('AAA'); $oHyperlink = $oTextRun->getHyperlink(); - $oHyperlink->setUrl('https://github.com/PHPOffice/PHPPowerPoint/'); + $oHyperlink->setUrl('https://github.com/PHPOffice/PHPPresentation/'); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $element = '/office:document-content/office:body/office:presentation/draw:page/draw:frame/table:table/table:table-row/table:table-cell/text:p/text:span/text:a'; $this->assertTrue($pres->elementExists($element, 'content.xml')); - $this->assertEquals('https://github.com/PHPOffice/PHPPowerPoint/', $pres->getElementAttribute($element, 'xlink:href', 'content.xml')); + $this->assertEquals('https://github.com/PHPOffice/PHPPresentation/', $pres->getElementAttribute($element, 'xlink:href', 'content.xml')); } public function testTableWithText() @@ -465,15 +465,15 @@ public function testTableWithText() $oRun = new Run(); $oRun->setText('Test'); - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $oShape = $oSlide->createTableShape(); $oRow = $oShape->createRow(); $oCell = $oRow->getCell(); $oCell->addText($oRun); $oCell->createBreak(); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $element = '/office:document-content/office:body/office:presentation/draw:page/draw:frame/table:table/table:table-row/table:table-cell/text:p/text:span'; $this->assertTrue($pres->elementExists($element, 'content.xml')); $this->assertEquals('Test', $pres->getElement($element, 'content.xml')->nodeValue); @@ -487,19 +487,19 @@ public function testTransition() $oTransition = new Transition(); - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $phpPresentation = new PhpPresentation(); + $oSlide = $phpPresentation->getActiveSlide(); $element = '/office:document-content/office:automatic-styles/style:style[@style:name=\'stylePage0\']/style:drawing-page-properties'; - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $this->assertTrue($pres->elementExists($element, 'content.xml')); $this->assertFalse($pres->attributeElementExists($element, 'presentation:duration', 'content.xml')); $oTransition->setTimeTrigger(true, $value); $oSlide->setTransition($oTransition); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $this->assertTrue($pres->elementExists($element, 'content.xml')); $this->assertTrue($pres->attributeElementExists($element, 'presentation:duration', 'content.xml')); $this->assertStringStartsWith('PT', $pres->getElementAttribute($element, 'presentation:duration', 'content.xml')); @@ -508,18 +508,18 @@ public function testTransition() $this->assertContains('automatic', $pres->getElementAttribute($element, 'presentation:transition-type', 'content.xml')); $oTransition->setSpeed(Transition::SPEED_FAST); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $this->assertContains('fast', $pres->getElementAttribute($element, 'presentation:transition-speed', 'content.xml')); $oTransition->setSpeed(Transition::SPEED_MEDIUM); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $this->assertContains('medium', $pres->getElementAttribute($element, 'presentation:transition-speed', 'content.xml')); $oTransition->setSpeed(Transition::SPEED_SLOW); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $this->assertContains('slow', $pres->getElementAttribute($element, 'presentation:transition-speed', 'content.xml')); - $rcTransition = new \ReflectionClass('PhpOffice\PhpPowerpoint\Slide\Transition'); + $rcTransition = new \ReflectionClass('PhpOffice\PhpPresentation\Slide\Transition'); $arrayConstants = $rcTransition->getConstants(); foreach ($arrayConstants as $key => $value) { if (strpos($key, 'TRANSITION_') !== 0) { @@ -528,7 +528,7 @@ public function testTransition() $oTransition->setTransitionType($rcTransition->getConstant($key)); $oSlide->setTransition($oTransition); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); switch ($key) { case 'TRANSITION_BLINDS_HORIZONTAL': $this->assertContains('horizontal-stripes', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml')); @@ -678,7 +678,7 @@ public function testTransition() } $oTransition->setManualTrigger(true); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation'); $this->assertContains('manual', $pres->getElementAttribute($element, 'presentation:transition-type', 'content.xml')); } } diff --git a/tests/PhpPresentation/Tests/Writer/ODPresentation/DrawingTest.php b/tests/PhpPresentation/Tests/Writer/ODPresentation/DrawingTest.php new file mode 100644 index 000000000..004fa1b48 --- /dev/null +++ b/tests/PhpPresentation/Tests/Writer/ODPresentation/DrawingTest.php @@ -0,0 +1,55 @@ +getActiveSlide(); + $oGroup = $oSlide->createGroup(); + + $oDrawing = new Drawing(); + $this->assertInternalType('array', $oDrawing->allDrawings($oPhpPresentation)); + $this->assertEmpty($oDrawing->allDrawings($oPhpPresentation)); + + $oGroup->createDrawingShape(); + $oGroup->createDrawingShape(); + $oGroup->createDrawingShape(); + + $this->assertInternalType('array', $oDrawing->allDrawings($oPhpPresentation)); + $this->assertCount(3, $oDrawing->allDrawings($oPhpPresentation)); + } +} diff --git a/tests/PhpPowerpoint/Tests/Writer/ODPresentation/ManifestTest.php b/tests/PhpPresentation/Tests/Writer/ODPresentation/ManifestTest.php similarity index 55% rename from tests/PhpPowerpoint/Tests/Writer/ODPresentation/ManifestTest.php rename to tests/PhpPresentation/Tests/Writer/ODPresentation/ManifestTest.php index 488ff89c3..5fbe01fa7 100644 --- a/tests/PhpPowerpoint/Tests/Writer/ODPresentation/ManifestTest.php +++ b/tests/PhpPresentation/Tests/Writer/ODPresentation/ManifestTest.php @@ -1,31 +1,31 @@ getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createDrawingShape(); - $oShape->setPath(PHPPOWERPOINT_TESTS_BASE_DIR.'/resources/images/PHPPowerPointLogo.png'); + $oShape->setPath(PHPPRESENTATION_TESTS_BASE_DIR.'/resources/images/PhpPresentationLogo.png'); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'ODPresentation'); $element = '/manifest:manifest/manifest:file-entry[5]'; $this->assertTrue($pres->elementExists($element, 'META-INF/manifest.xml')); $this->assertEquals('Pictures/'.md5($oShape->getPath()).'.'.$oShape->getExtension(), $pres->getElementAttribute($element, 'manifest:full-path', 'META-INF/manifest.xml')); @@ -52,17 +52,17 @@ public function testDrawing() public function testMemoryDrawing() { - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = new MemoryDrawing(); $gdImage = @imagecreatetruecolor(140, 20); $textColor = imagecolorallocate($gdImage, 255, 255, 255); - imagestring($gdImage, 1, 5, 5, 'Created with PHPPowerPoint', $textColor); + imagestring($gdImage, 1, 5, 5, 'Created with PhpPresentation', $textColor); $oShape->setImageResource($gdImage)->setRenderingFunction(MemoryDrawing::RENDERING_JPEG)->setMimeType(MemoryDrawing::MIMETYPE_DEFAULT); $oSlide->addShape($oShape); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'ODPresentation'); $element = '/manifest:manifest/manifest:file-entry[5]'; $this->assertTrue($pres->elementExists($element, 'META-INF/manifest.xml')); $this->assertEquals('Pictures/'.$oShape->getIndexedFilename(), $pres->getElementAttribute($element, 'manifest:full-path', 'META-INF/manifest.xml')); diff --git a/tests/PhpPowerpoint/Tests/Writer/ODPresentation/StylesTest.php b/tests/PhpPresentation/Tests/Writer/ODPresentation/StylesTest.php similarity index 76% rename from tests/PhpPowerpoint/Tests/Writer/ODPresentation/StylesTest.php rename to tests/PhpPresentation/Tests/Writer/ODPresentation/StylesTest.php index 83f62b797..a741d2c1d 100644 --- a/tests/PhpPowerpoint/Tests/Writer/ODPresentation/StylesTest.php +++ b/tests/PhpPresentation/Tests/Writer/ODPresentation/StylesTest.php @@ -1,34 +1,34 @@ setDocumentLayout(DocumentLayout::LAYOUT_A4, true); - $phpPowerPoint->setLayout($oDocumentLayout); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $oPhpPresentation->setLayout($oDocumentLayout); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'ODPresentation'); $this->assertTrue($pres->elementExists($element, 'styles.xml')); $this->assertEquals('landscape', $pres->getElementAttribute($element, 'style:print-orientation', 'styles.xml')); $oDocumentLayout->setDocumentLayout(DocumentLayout::LAYOUT_A4, false); - $phpPowerPoint->setLayout($oDocumentLayout); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $oPhpPresentation->setLayout($oDocumentLayout); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'ODPresentation'); $this->assertTrue($pres->elementExists($element, 'styles.xml')); $this->assertEquals('portrait', $pres->getElementAttribute($element, 'style:print-orientation', 'styles.xml')); } public function testCustomDocumentLayout() { - $phpPowerPoint = new PhpPowerpoint(); + $oPhpPresentation = new PhpPresentation(); $oDocumentLayout = new DocumentLayout(); $oDocumentLayout->setDocumentLayout(array('cx' => rand(1, 100),'cy' => rand(1, 100),)); - $phpPowerPoint->setLayout($oDocumentLayout); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $oPhpPresentation->setLayout($oDocumentLayout); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'ODPresentation'); $element = "/office:document-styles/office:automatic-styles/style:page-layout"; $this->assertTrue($pres->elementExists($element, 'styles.xml')); @@ -79,12 +79,12 @@ public function testCustomDocumentLayout() public function testFillGradientLinearRichText() { - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createRichTextShape(); $oShape->getFill()->setFillType(Fill::FILL_GRADIENT_LINEAR)->setStartColor(new Color('FFFF7700'))->setEndColor(new Color('FFFFFFFF')); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'ODPresentation'); $element = '/office:document-styles/office:styles/draw:gradient'; $this->assertEquals('gradient_'.$oShape->getFill()->getHashCode(), $pres->getElementAttribute($element, 'draw:name', 'styles.xml')); @@ -96,12 +96,12 @@ public function testFillGradientLinearRichText() public function testFillSolidRichText() { - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createRichTextShape(); $oShape->getFill()->setFillType(Fill::FILL_SOLID)->setRotation(90)->setStartColor(new Color('FF4672A8'))->setEndColor(new Color('FF4672A8')); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'ODPresentation'); $element = '/office:document-content/office:automatic-styles/style:style[@style:name=\'gr1\']/style:graphic-properties'; $this->assertTrue($pres->elementExists($element, 'content.xml')); $this->assertEquals('solid', $pres->getElementAttribute($element, 'draw:fill', 'content.xml')); @@ -111,22 +111,22 @@ public function testFillSolidRichText() public function testGradientTable() { - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createTableShape(); $oRow = $oShape->createRow(); $oCell = $oRow->getCell(); $oCell->getFill()->setFillType(Fill::FILL_GRADIENT_LINEAR)->setStartColor(new Color('FFFF7700'))->setEndColor(new Color('FFFFFFFF')); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'ODPresentation'); $element = "/office:document-styles/office:styles/draw:gradient"; $this->assertEquals('gradient_'.$oCell->getFill()->getHashCode(), $pres->getElementAttribute($element, 'draw:name', 'styles.xml')); } public function testStrokeDash() { - $phpPowerPoint = new PhpPowerpoint(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oRichText1 = $oSlide->createRichTextShape(); $oRichText1->getBorder()->setColor(new Color('FF4672A8'))->setLineStyle(Border::LINE_SINGLE); $arrayDashStyle = array( @@ -145,7 +145,7 @@ public function testStrokeDash() foreach ($arrayDashStyle as $style) { $oRichText1->getBorder()->setDashStyle($style); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'ODPresentation'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'ODPresentation'); $element = '/office:document-styles/office:styles/draw:stroke-dash[@draw:name=\'strokeDash_'.$style.'\']'; $this->assertTrue($pres->elementExists($element, 'styles.xml')); $this->assertEquals('rect', $pres->getElementAttribute($element, 'draw:style', 'styles.xml')); diff --git a/tests/PhpPowerpoint/Tests/Writer/ODPresentationTest.php b/tests/PhpPresentation/Tests/Writer/ODPresentationTest.php similarity index 57% rename from tests/PhpPowerpoint/Tests/Writer/ODPresentationTest.php rename to tests/PhpPresentation/Tests/Writer/ODPresentationTest.php index 62a25f7a5..72047913e 100644 --- a/tests/PhpPowerpoint/Tests/Writer/ODPresentationTest.php +++ b/tests/PhpPresentation/Tests/Writer/ODPresentationTest.php @@ -1,29 +1,29 @@ 'Content', 'manifest' => 'Manifest', @@ -42,16 +42,16 @@ public function testConstruct() 'drawing' => 'Drawing', ); - $phpPowerPoint = new PhpPowerpoint(); - $phpPowerPoint->getActiveSlide()->createDrawingShape(); - $object = new ODPresentation($phpPowerPoint); + $oPhpPresentation = new PhpPresentation(); + $oPhpPresentation->getActiveSlide()->createDrawingShape(); + $object = new ODPresentation($oPhpPresentation); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\PhpPowerpoint', $object->getPHPPowerPoint()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $object->getPhpPresentation()); $this->assertEquals('./', $object->getDiskCachingDirectory()); foreach ($parts as $partName => $objectName) { $this->assertInstanceOf($objectPrefix . $objectName, $object->getWriterPart($partName)); } - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\HashTable', $object->getDrawingHashTable()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\HashTable', $object->getDrawingHashTable()); } /** @@ -59,18 +59,18 @@ public function testConstruct() */ public function testSave() { - $filename = tempnam(sys_get_temp_dir(), 'PHPPowerPoint'); - $imageFile = PHPPOWERPOINT_TESTS_BASE_DIR . '/resources/images/PHPPowerPointLogo.png'; + $filename = tempnam(sys_get_temp_dir(), 'PhpPresentation'); + $imageFile = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/images/PhpPresentationLogo.png'; - $phpPowerPoint = new PhpPowerpoint(); - $slide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $slide = $oPhpPresentation->getActiveSlide(); $slide->createRichTextShape(); $slide->createLineShape(10, 10, 10, 10); - $slide->createChartShape()->getPlotArea()->setType(new \PhpOffice\PhpPowerpoint\Shape\Chart\Type\Bar3D()); + $slide->createChartShape()->getPlotArea()->setType(new \PhpOffice\PhpPresentation\Shape\Chart\Type\Bar3D()); $slide->createDrawingShape()->setName('Drawing')->setPath($imageFile); $slide->createTableShape()->createRow(); - $object = new ODPresentation($phpPowerPoint); + $object = new ODPresentation($oPhpPresentation); $object->save($filename); $this->assertTrue(file_exists($filename)); @@ -79,7 +79,7 @@ public function testSave() } /** - * Test get PHPPowerPoint exception + * Test get PhpPresentation exception * * @expectedException Exception * @expectedExceptionMessage Filename is empty @@ -95,21 +95,21 @@ public function testSaveEmpty() */ public function testGetWriterPartNull() { - $object = new ODPresentation(new PhpPowerpoint()); + $object = new ODPresentation(new PhpPresentation()); $this->assertNull($object->getWriterPart('foo')); } /** - * Test get PHPPowerPoint exception + * Test get PhpPresentation exception * * @expectedException Exception - * @expectedExceptionMessage No PHPPowerPoint assigned. + * @expectedExceptionMessage No PhpPresentation assigned. */ - public function testGetPHPPowerPointException() + public function testGetPhpPresentationException() { $object = new ODPresentation(); - $object->getPHPPowerPoint(); + $object->getPhpPresentation(); } /** @@ -117,7 +117,7 @@ public function testGetPHPPowerPointException() */ public function testSetGetUseDiskCaching() { - $object = new ODPresentation(new PhpPowerpoint()); + $object = new ODPresentation(new PhpPresentation()); $this->assertFalse($object->hasDiskCaching()); $object->setUseDiskCaching(true, sys_get_temp_dir()); @@ -132,7 +132,7 @@ public function testSetGetUseDiskCaching() */ public function testSetUseDiskCachingException() { - $object = new ODPresentation(new PhpPowerpoint()); + $object = new ODPresentation(new PhpPresentation()); $object->setUseDiskCaching(true, 'foo'); } } diff --git a/tests/PhpPowerpoint/Tests/Writer/PowerPoint2007/AbstractPartTest.php b/tests/PhpPresentation/Tests/Writer/PowerPoint2007/AbstractPartTest.php similarity index 62% rename from tests/PhpPowerpoint/Tests/Writer/PowerPoint2007/AbstractPartTest.php rename to tests/PhpPresentation/Tests/Writer/PowerPoint2007/AbstractPartTest.php index 73f251a29..8003cf090 100644 --- a/tests/PhpPowerpoint/Tests/Writer/PowerPoint2007/AbstractPartTest.php +++ b/tests/PhpPresentation/Tests/Writer/PowerPoint2007/AbstractPartTest.php @@ -1,32 +1,32 @@ 2, ); - $oPHPPowerPoint = new PhpPowerpoint(); - $oSlide = $oPHPPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createChartShape(); $oShape->setResizeProportional(false)->setHeight(550)->setWidth(700)->setOffsetX(120)->setOffsetY(80); $oArea = new Area(); @@ -61,7 +61,7 @@ public function testTypeArea() $oArea->addSeries($oSeries); $oShape->getPlotArea()->setType($oArea); - $oXMLDoc = TestHelperDOCX::getDocument($oPHPPowerPoint, 'PowerPoint2007'); + $oXMLDoc = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData'; $this->assertTrue($oXMLDoc->elementExists($element, 'ppt/slides/slide1.xml')); diff --git a/tests/PhpPowerpoint/Tests/Writer/PowerPoint2007/ChartBarTest.php b/tests/PhpPresentation/Tests/Writer/PowerPoint2007/ChartBarTest.php similarity index 72% rename from tests/PhpPowerpoint/Tests/Writer/PowerPoint2007/ChartBarTest.php rename to tests/PhpPresentation/Tests/Writer/PowerPoint2007/ChartBarTest.php index 6d7d06e93..af195a5b2 100644 --- a/tests/PhpPowerpoint/Tests/Writer/PowerPoint2007/ChartBarTest.php +++ b/tests/PhpPresentation/Tests/Writer/PowerPoint2007/ChartBarTest.php @@ -1,30 +1,30 @@ 2, ); - $oPHPPowerPoint = new PhpPowerpoint(); - $oSlide = $oPHPPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createChartShape(); $oShape->setResizeProportional(false)->setHeight(550)->setWidth(700)->setOffsetX(120)->setOffsetY(80); $oBar = new Bar(); @@ -65,7 +65,7 @@ public function testTypeBar() $oBar->addSeries($oSeries); $oShape->getPlotArea()->setType($oBar); - $oXMLDoc = TestHelperDOCX::getDocument($oPHPPowerPoint, 'PowerPoint2007'); + $oXMLDoc = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData'; $this->assertTrue($oXMLDoc->elementExists($element, 'ppt/slides/slide1.xml')); diff --git a/tests/PhpPowerpoint/Tests/Writer/PowerPoint2007/ChartTest.php b/tests/PhpPresentation/Tests/Writer/PowerPoint2007/ChartTest.php similarity index 81% rename from tests/PhpPowerpoint/Tests/Writer/PowerPoint2007/ChartTest.php rename to tests/PhpPresentation/Tests/Writer/PowerPoint2007/ChartTest.php index c83346bd3..4aa9a6218 100644 --- a/tests/PhpPowerpoint/Tests/Writer/PowerPoint2007/ChartTest.php +++ b/tests/PhpPresentation/Tests/Writer/PowerPoint2007/ChartTest.php @@ -1,34 +1,34 @@ getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createChartShape(); $oShape->setResizeProportional(false)->setHeight(550)->setWidth(700)->setOffsetX(120)->setOffsetY(80); - $stub = $this->getMockForAbstractClass('PhpOffice\PhpPowerpoint\Shape\Chart\Type\AbstractType'); + $stub = $this->getMockForAbstractClass('PhpOffice\PhpPresentation\Shape\Chart\Type\AbstractType'); $oShape->getPlotArea()->setType($stub); - TestHelperDOCX::getDocument($oPHPPowerPoint, 'PowerPoint2007'); + TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); } public function testTitleVisibility() { $element = '/c:chartSpace/c:chart/c:autoTitleDeleted'; - $oPHPPowerPoint = new PhpPowerpoint(); - $oSlide = $oPHPPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createChartShape(); $oLine = new Line(); $oShape->getPlotArea()->setType($oLine); $this->assertTrue($oShape->getTitle()->isVisible()); - $this->assertInstanceOf('PhpOffice\PhpPowerpoint\Shape\Chart\Title', $oShape->getTitle()->setVisible(true)); - $oXMLDoc = TestHelperDOCX::getDocument($oPHPPowerPoint, 'PowerPoint2007'); + $this->assertInstanceOf('PhpOffice\PhpPresentation\Shape\Chart\Title', $oShape->getTitle()->setVisible(true)); + $oXMLDoc = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $this->assertTrue($oXMLDoc->elementExists($element, 'ppt/charts/'.$oShape->getIndexedFilename())); $this->assertEquals('0', $oXMLDoc->getElementAttribute($element, 'val', 'ppt/charts/'.$oShape->getIndexedFilename())); - $this->assertInstanceOf('PhpOffice\PhpPowerpoint\Shape\Chart\Title', $oShape->getTitle()->setVisible(false)); - $oXMLDoc = TestHelperDOCX::getDocument($oPHPPowerPoint, 'PowerPoint2007'); + $this->assertInstanceOf('PhpOffice\PhpPresentation\Shape\Chart\Title', $oShape->getTitle()->setVisible(false)); + $oXMLDoc = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $this->assertTrue($oXMLDoc->elementExists($element, 'ppt/charts/'.$oShape->getIndexedFilename())); $this->assertEquals('1', $oXMLDoc->getElementAttribute($element, 'val', 'ppt/charts/'.$oShape->getIndexedFilename())); } @@ -103,8 +103,8 @@ public function testTypeBar3D() 'E' => 2, ); - $oPHPPowerPoint = new PhpPowerpoint(); - $oSlide = $oPHPPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createChartShape(); $oShape->setResizeProportional(false)->setHeight(550)->setWidth(700)->setOffsetX(120)->setOffsetY(80); $oBar3D = new Bar3D(); @@ -117,7 +117,7 @@ public function testTypeBar3D() $oBar3D->addSeries($oSeries); $oShape->getPlotArea()->setType($oBar3D); - $oXMLDoc = TestHelperDOCX::getDocument($oPHPPowerPoint, 'PowerPoint2007'); + $oXMLDoc = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData'; $this->assertTrue($oXMLDoc->elementExists($element, 'ppt/slides/slide1.xml')); @@ -141,8 +141,8 @@ public function testTypeBar3DSubScript() 'E' => 2, ); - $oPHPPowerPoint = new PhpPowerpoint(); - $oSlide = $oPHPPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createChartShape(); $oShape->setResizeProportional(false)->setHeight(550)->setWidth(700)->setOffsetX(120)->setOffsetY(80); $oBar3D = new Bar3D(); @@ -151,7 +151,7 @@ public function testTypeBar3DSubScript() $oBar3D->addSeries($oSeries); $oShape->getPlotArea()->setType($oBar3D); - $oXMLDoc = TestHelperDOCX::getDocument($oPHPPowerPoint, 'PowerPoint2007'); + $oXMLDoc = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/c:chartSpace/c:chart/c:plotArea/c:bar3DChart/c:ser/c:dLbls/c:txPr/a:p/a:pPr/a:defRPr'; $this->assertTrue($oXMLDoc->elementExists($element, 'ppt/charts/'.$oShape->getIndexedFilename())); @@ -168,8 +168,8 @@ public function testTypeBar3DSuperScript() 'E' => 2, ); - $oPHPPowerPoint = new PhpPowerpoint(); - $oSlide = $oPHPPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createChartShape(); $oShape->setResizeProportional(false)->setHeight(550)->setWidth(700)->setOffsetX(120)->setOffsetY(80); $oBar3D = new Bar3D(); @@ -178,7 +178,7 @@ public function testTypeBar3DSuperScript() $oBar3D->addSeries($oSeries); $oShape->getPlotArea()->setType($oBar3D); - $oXMLDoc = TestHelperDOCX::getDocument($oPHPPowerPoint, 'PowerPoint2007'); + $oXMLDoc = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/c:chartSpace/c:chart/c:plotArea/c:bar3DChart/c:ser/c:dLbls/c:txPr/a:p/a:pPr/a:defRPr'; $this->assertTrue($oXMLDoc->elementExists($element, 'ppt/charts/'.$oShape->getIndexedFilename())); @@ -195,8 +195,8 @@ public function testTypeBar3DBarDirection() 'E' => 2, ); - $oPHPPowerPoint = new PhpPowerpoint(); - $oSlide = $oPHPPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createChartShape(); $oShape->setResizeProportional(false)->setHeight(550)->setWidth(700)->setOffsetX(120)->setOffsetY(80); $oBar3D = new Bar3D(); @@ -205,7 +205,7 @@ public function testTypeBar3DBarDirection() $oBar3D->addSeries($oSeries); $oShape->getPlotArea()->setType($oBar3D); - $oXMLDoc = TestHelperDOCX::getDocument($oPHPPowerPoint, 'PowerPoint2007'); + $oXMLDoc = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/c:chartSpace/c:chart/c:plotArea/c:bar3DChart/c:barDir'; $this->assertTrue($oXMLDoc->elementExists($element, 'ppt/charts/'.$oShape->getIndexedFilename())); @@ -222,8 +222,8 @@ public function testTypeLine() 'E' => 2, ); - $oPHPPowerPoint = new PhpPowerpoint(); - $oSlide = $oPHPPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createChartShape(); $oShape->setResizeProportional(false)->setHeight(550)->setWidth(700)->setOffsetX(120)->setOffsetY(80); $oLine = new Line(); @@ -231,7 +231,7 @@ public function testTypeLine() $oLine->addSeries($oSeries); $oShape->getPlotArea()->setType($oLine); - $oXMLDoc = TestHelperDOCX::getDocument($oPHPPowerPoint, 'PowerPoint2007'); + $oXMLDoc = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData'; $this->assertTrue($oXMLDoc->elementExists($element, 'ppt/slides/slide1.xml')); @@ -253,8 +253,8 @@ public function testTypeLineSubScript() 'E' => 2, ); - $oPHPPowerPoint = new PhpPowerpoint(); - $oSlide = $oPHPPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createChartShape(); $oShape->setResizeProportional(false)->setHeight(550)->setWidth(700)->setOffsetX(120)->setOffsetY(80); $oLine = new Line(); @@ -263,7 +263,7 @@ public function testTypeLineSubScript() $oLine->addSeries($oSeries); $oShape->getPlotArea()->setType($oLine); - $oXMLDoc = TestHelperDOCX::getDocument($oPHPPowerPoint, 'PowerPoint2007'); + $oXMLDoc = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:dLbls/c:txPr/a:p/a:pPr/a:defRPr'; $this->assertTrue($oXMLDoc->elementExists($element, 'ppt/charts/'.$oShape->getIndexedFilename())); @@ -280,8 +280,8 @@ public function testTypeLineSuperScript() 'E' => 2, ); - $oPHPPowerPoint = new PhpPowerpoint(); - $oSlide = $oPHPPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createChartShape(); $oShape->setResizeProportional(false)->setHeight(550)->setWidth(700)->setOffsetX(120)->setOffsetY(80); $oLine = new Line(); @@ -290,7 +290,7 @@ public function testTypeLineSuperScript() $oLine->addSeries($oSeries); $oShape->getPlotArea()->setType($oLine); - $oXMLDoc = TestHelperDOCX::getDocument($oPHPPowerPoint, 'PowerPoint2007'); + $oXMLDoc = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:dLbls/c:txPr/a:p/a:pPr/a:defRPr'; $this->assertTrue($oXMLDoc->elementExists($element, 'ppt/charts/'.$oShape->getIndexedFilename())); @@ -307,8 +307,8 @@ public function testTypePie() 'E' => 2, ); - $oPHPPowerPoint = new PhpPowerpoint(); - $oSlide = $oPHPPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createChartShape(); $oShape->setResizeProportional(false)->setHeight(550)->setWidth(700)->setOffsetX(120)->setOffsetY(80); $oPie = new Pie(); @@ -321,7 +321,7 @@ public function testTypePie() $oPie->addSeries($oSeries); $oShape->getPlotArea()->setType($oPie); - $oXMLDoc = TestHelperDOCX::getDocument($oPHPPowerPoint, 'PowerPoint2007'); + $oXMLDoc = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData'; $this->assertTrue($oXMLDoc->elementExists($element, 'ppt/slides/slide1.xml')); @@ -344,8 +344,8 @@ public function testTypePie3D() 'E' => 2, ); - $oPHPPowerPoint = new PhpPowerpoint(); - $oSlide = $oPHPPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createChartShape(); $oShape->setResizeProportional(false)->setHeight(550)->setWidth(700)->setOffsetX(120)->setOffsetY(80); $oPie3D = new Pie3D(); @@ -358,7 +358,7 @@ public function testTypePie3D() $oPie3D->addSeries($oSeries); $oShape->getPlotArea()->setType($oPie3D); - $oXMLDoc = TestHelperDOCX::getDocument($oPHPPowerPoint, 'PowerPoint2007'); + $oXMLDoc = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData'; $this->assertTrue($oXMLDoc->elementExists($element, 'ppt/slides/slide1.xml')); @@ -383,8 +383,8 @@ public function testTypePie3DExplosion() 'E' => 2, ); - $oPHPPowerPoint = new PhpPowerpoint(); - $oSlide = $oPHPPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createChartShape(); $oShape->setResizeProportional(false)->setHeight(550)->setWidth(700)->setOffsetX(120)->setOffsetY(80); $oPie3D = new Pie3D(); @@ -393,7 +393,7 @@ public function testTypePie3DExplosion() $oPie3D->addSeries($oSeries); $oShape->getPlotArea()->setType($oPie3D); - $oXMLDoc = TestHelperDOCX::getDocument($oPHPPowerPoint, 'PowerPoint2007'); + $oXMLDoc = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/c:chartSpace/c:chart/c:plotArea/c:pie3DChart/c:ser/c:explosion'; $this->assertTrue($oXMLDoc->elementExists($element, 'ppt/charts/'.$oShape->getIndexedFilename())); @@ -410,8 +410,8 @@ public function testTypePie3DSubScript() 'E' => 2, ); - $oPHPPowerPoint = new PhpPowerpoint(); - $oSlide = $oPHPPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createChartShape(); $oShape->setResizeProportional(false)->setHeight(550)->setWidth(700)->setOffsetX(120)->setOffsetY(80); $oPie3D = new Pie3D(); @@ -420,7 +420,7 @@ public function testTypePie3DSubScript() $oPie3D->addSeries($oSeries); $oShape->getPlotArea()->setType($oPie3D); - $oXMLDoc = TestHelperDOCX::getDocument($oPHPPowerPoint, 'PowerPoint2007'); + $oXMLDoc = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/c:chartSpace/c:chart/c:plotArea/c:pie3DChart/c:ser/c:dLbls/c:txPr/a:p/a:pPr/a:defRPr'; $this->assertTrue($oXMLDoc->elementExists($element, 'ppt/charts/'.$oShape->getIndexedFilename())); @@ -437,8 +437,8 @@ public function testTypePie3DSuperScript() 'E' => 2, ); - $oPHPPowerPoint = new PhpPowerpoint(); - $oSlide = $oPHPPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createChartShape(); $oShape->setResizeProportional(false)->setHeight(550)->setWidth(700)->setOffsetX(120)->setOffsetY(80); $oPie3D = new Pie3D(); @@ -447,7 +447,7 @@ public function testTypePie3DSuperScript() $oPie3D->addSeries($oSeries); $oShape->getPlotArea()->setType($oPie3D); - $oXMLDoc = TestHelperDOCX::getDocument($oPHPPowerPoint, 'PowerPoint2007'); + $oXMLDoc = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/c:chartSpace/c:chart/c:plotArea/c:pie3DChart/c:ser/c:dLbls/c:txPr/a:p/a:pPr/a:defRPr'; $this->assertTrue($oXMLDoc->elementExists($element, 'ppt/charts/'.$oShape->getIndexedFilename())); @@ -464,8 +464,8 @@ public function testTypeScatter() 'E' => 2, ); - $oPHPPowerPoint = new PhpPowerpoint(); - $oSlide = $oPHPPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createChartShape(); $oShape->setResizeProportional(false)->setHeight(550)->setWidth(700)->setOffsetX(120)->setOffsetY(80); $oScatter = new Scatter(); @@ -473,7 +473,7 @@ public function testTypeScatter() $oScatter->addSeries($oSeries); $oShape->getPlotArea()->setType($oScatter); - $oXMLDoc = TestHelperDOCX::getDocument($oPHPPowerPoint, 'PowerPoint2007'); + $oXMLDoc = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData'; $this->assertTrue($oXMLDoc->elementExists($element, 'ppt/slides/slide1.xml')); @@ -495,8 +495,8 @@ public function testTypeScatterSubScript() 'E' => 2, ); - $oPHPPowerPoint = new PhpPowerpoint(); - $oSlide = $oPHPPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createChartShape(); $oShape->setResizeProportional(false)->setHeight(550)->setWidth(700)->setOffsetX(120)->setOffsetY(80); $oScatter = new Scatter(); @@ -505,7 +505,7 @@ public function testTypeScatterSubScript() $oScatter->addSeries($oSeries); $oShape->getPlotArea()->setType($oScatter); - $oXMLDoc = TestHelperDOCX::getDocument($oPHPPowerPoint, 'PowerPoint2007'); + $oXMLDoc = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:dLbls/c:txPr/a:p/a:pPr/a:defRPr'; $this->assertTrue($oXMLDoc->elementExists($element, 'ppt/charts/'.$oShape->getIndexedFilename())); @@ -522,8 +522,8 @@ public function testTypeScatterSuperScript() 'E' => 2, ); - $oPHPPowerPoint = new PhpPowerpoint(); - $oSlide = $oPHPPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createChartShape(); $oShape->setResizeProportional(false)->setHeight(550)->setWidth(700)->setOffsetX(120)->setOffsetY(80); $oScatter = new Scatter(); @@ -532,7 +532,7 @@ public function testTypeScatterSuperScript() $oScatter->addSeries($oSeries); $oShape->getPlotArea()->setType($oScatter); - $oXMLDoc = TestHelperDOCX::getDocument($oPHPPowerPoint, 'PowerPoint2007'); + $oXMLDoc = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:dLbls/c:txPr/a:p/a:pPr/a:defRPr'; $this->assertTrue($oXMLDoc->elementExists($element, 'ppt/charts/'.$oShape->getIndexedFilename())); diff --git a/tests/PhpPresentation/Tests/Writer/PowerPoint2007/ContenTypesTest.php b/tests/PhpPresentation/Tests/Writer/PowerPoint2007/ContenTypesTest.php new file mode 100644 index 000000000..d1b4dce51 --- /dev/null +++ b/tests/PhpPresentation/Tests/Writer/PowerPoint2007/ContenTypesTest.php @@ -0,0 +1,50 @@ +setParentWriter(new ODPresentation()); + $oContentTypes->writeContentTypes(new PhpPresentation()); + } +} diff --git a/tests/PhpPresentation/Tests/Writer/PowerPoint2007/DrawingTest.php b/tests/PhpPresentation/Tests/Writer/PowerPoint2007/DrawingTest.php new file mode 100644 index 000000000..d86f6849a --- /dev/null +++ b/tests/PhpPresentation/Tests/Writer/PowerPoint2007/DrawingTest.php @@ -0,0 +1,55 @@ +getActiveSlide(); + $oGroup = $oSlide->createGroup(); + + $oDrawing = new Drawing(); + $this->assertInternalType('array', $oDrawing->allDrawings($oPhpPresentation)); + $this->assertEmpty($oDrawing->allDrawings($oPhpPresentation)); + + $oGroup->createDrawingShape(); + $oGroup->createDrawingShape(); + $oGroup->createDrawingShape(); + + $this->assertInternalType('array', $oDrawing->allDrawings($oPhpPresentation)); + $this->assertCount(3, $oDrawing->allDrawings($oPhpPresentation)); + } +} diff --git a/tests/PhpPowerpoint/Tests/Writer/PowerPoint2007/LayoutPack/TemplateBasedTest.php b/tests/PhpPresentation/Tests/Writer/PowerPoint2007/LayoutPack/TemplateBasedTest.php similarity index 65% rename from tests/PhpPowerpoint/Tests/Writer/PowerPoint2007/LayoutPack/TemplateBasedTest.php rename to tests/PhpPresentation/Tests/Writer/PowerPoint2007/LayoutPack/TemplateBasedTest.php index d632d3e46..c489733b5 100644 --- a/tests/PhpPowerpoint/Tests/Writer/PowerPoint2007/LayoutPack/TemplateBasedTest.php +++ b/tests/PhpPresentation/Tests/Writer/PowerPoint2007/LayoutPack/TemplateBasedTest.php @@ -1,23 +1,23 @@ getLayouts(); @@ -43,7 +43,7 @@ public function testFindLayout() */ public function testFindLayoutException() { - $file = PHPPOWERPOINT_TESTS_BASE_DIR . '/resources/files/Sample_00_01.pptx'; + $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_00_01.pptx'; $templateBased = new TemplateBased($file); $name = 'Invalid'; $templateBased->findLayout($name); @@ -51,7 +51,7 @@ public function testFindLayoutException() public function testFindLayoutId() { - $file = PHPPOWERPOINT_TESTS_BASE_DIR . '/resources/files/Sample_00_01.pptx'; + $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_00_01.pptx'; $templateBased = new TemplateBased($file); $layouts = $templateBased->getLayouts(); @@ -66,7 +66,7 @@ public function testFindLayoutId() */ public function testFindLayoutIdException() { - $file = PHPPOWERPOINT_TESTS_BASE_DIR . '/resources/files/Sample_00_01.pptx'; + $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_00_01.pptx'; $templateBased = new TemplateBased($file); $name = 'Invalid'; $templateBased->findLayoutId($name); diff --git a/tests/PhpPowerpoint/Tests/Writer/PowerPoint2007/PptPropsTest.php b/tests/PhpPresentation/Tests/Writer/PowerPoint2007/PptPropsTest.php similarity index 61% rename from tests/PhpPowerpoint/Tests/Writer/PowerPoint2007/PptPropsTest.php rename to tests/PhpPresentation/Tests/Writer/PowerPoint2007/PptPropsTest.php index 1f0d4b967..45f68477e 100644 --- a/tests/PhpPowerpoint/Tests/Writer/PowerPoint2007/PptPropsTest.php +++ b/tests/PhpPresentation/Tests/Writer/PowerPoint2007/PptPropsTest.php @@ -1,25 +1,25 @@ assertTrue($pres->elementExists($element, 'ppt/presProps.xml')); $this->assertEquals('{E76CE94A-603C-4142-B9EB-6D1370010A27}', $pres->getElementAttribute($element, 'uri', 'ppt/presProps.xml')); @@ -48,9 +48,9 @@ public function testPresProps() public function testTableStyles() { - $phpPowerPoint = new PhpPowerpoint(); + $oPhpPresentation = new PhpPresentation(); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/a:tblStyleLst'; $this->assertTrue($pres->elementExists($element, 'ppt/tableStyles.xml')); $this->assertEquals('{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}', $pres->getElementAttribute($element, 'def', 'ppt/tableStyles.xml')); @@ -58,9 +58,9 @@ public function testTableStyles() public function testViewProps() { - $phpPowerPoint = new PhpPowerpoint(); + $oPhpPresentation = new PhpPresentation(); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:viewPr'; $this->assertTrue($pres->elementExists($element, 'ppt/viewProps.xml')); $this->assertEquals('0', $pres->getElementAttribute($element, 'showComments', 'ppt/viewProps.xml')); diff --git a/tests/PhpPowerpoint/Tests/Writer/PowerPoint2007/SlideTest.php b/tests/PhpPresentation/Tests/Writer/PowerPoint2007/SlideTest.php similarity index 91% rename from tests/PhpPowerpoint/Tests/Writer/PowerPoint2007/SlideTest.php rename to tests/PhpPresentation/Tests/Writer/PowerPoint2007/SlideTest.php index 7dfaedcf4..b3a908726 100644 --- a/tests/PhpPowerpoint/Tests/Writer/PowerPoint2007/SlideTest.php +++ b/tests/PhpPresentation/Tests/Writer/PowerPoint2007/SlideTest.php @@ -1,34 +1,34 @@ getActiveSlide(); $oShape = $oSlide->createRichTextShape()->setWidth(400)->setHeight(400)->setOffsetX(100)->setOffsetY(100); $oShape->createTextRun('this text should be vertically aligned'); @@ -73,11 +73,11 @@ public function testAlignmentShapeAuto() } /** - * @link https://github.com/PHPOffice/PHPPowerPoint/issues/42 + * @link https://github.com/PHPOffice/PHPPresentation/issues/42 */ public function testAlignmentShapeBase() { - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oShape = $oSlide->createRichTextShape()->setWidth(400)->setHeight(400)->setOffsetX(100)->setOffsetY(100); $oShape->createTextRun('this text should be vertically aligned'); @@ -90,11 +90,11 @@ public function testAlignmentShapeBase() } /** - * @link https://github.com/PHPOffice/PHPPowerPoint/issues/35 + * @link https://github.com/PHPOffice/PHPPresentation/issues/35 */ public function testAlignmentShapeBottom() { - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oShape = $oSlide->createRichTextShape()->setWidth(400)->setHeight(400)->setOffsetX(100)->setOffsetY(100); $oShape->createTextRun('this text should be vertically aligned'); @@ -107,11 +107,11 @@ public function testAlignmentShapeBottom() } /** - * @link https://github.com/PHPOffice/PHPPowerPoint/issues/35 + * @link https://github.com/PHPOffice/PHPPresentation/issues/35 */ public function testAlignmentShapeCenter() { - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oShape = $oSlide->createRichTextShape()->setWidth(400)->setHeight(400)->setOffsetX(100)->setOffsetY(100); $oShape->createTextRun('this text should be vertically aligned'); @@ -124,11 +124,11 @@ public function testAlignmentShapeCenter() } /** - * @link https://github.com/PHPOffice/PHPPowerPoint/issues/35 + * @link https://github.com/PHPOffice/PHPPresentation/issues/35 */ public function testAlignmentShapeTop() { - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oShape = $oSlide->createRichTextShape()->setWidth(400)->setHeight(400)->setOffsetX(100)->setOffsetY(100); $oShape->createTextRun('this text should be vertically aligned'); @@ -142,11 +142,11 @@ public function testAlignmentShapeTop() public function testDrawingWithHyperlink() { - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oShape = $oSlide->createDrawingShape(); - $oShape->setPath(PHPPOWERPOINT_TESTS_BASE_DIR.'/resources/images/PHPPowerPointLogo.png'); - $oShape->getHyperlink()->setUrl('https://github.com/PHPOffice/PHPPowerPoint/'); + $oShape->setPath(PHPPRESENTATION_TESTS_BASE_DIR.'/resources/images/PhpPresentationLogo.png'); + $oShape->getHyperlink()->setUrl('https://github.com/PHPOffice/PHPPresentation/'); $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); @@ -157,10 +157,10 @@ public function testDrawingWithHyperlink() public function testDrawingShapeBorder() { - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oShape = $oSlide->createDrawingShape(); - $oShape->setPath(PHPPOWERPOINT_TESTS_BASE_DIR.'/resources/images/PHPPowerPointLogo.png'); + $oShape->setPath(PHPPRESENTATION_TESTS_BASE_DIR.'/resources/images/PhpPresentationLogo.png'); $oShape->getBorder()->setLineStyle(Border::LINE_DOUBLE); $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); @@ -172,10 +172,10 @@ public function testDrawingShapeBorder() public function testDrawingShapeShadow() { - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oShape = $oSlide->createDrawingShape(); - $oShape->setPath(PHPPOWERPOINT_TESTS_BASE_DIR.'/resources/images/PHPPowerPointLogo.png'); + $oShape->setPath(PHPPRESENTATION_TESTS_BASE_DIR.'/resources/images/PhpPresentationLogo.png'); $oShape->getShadow()->setVisible(true)->setDirection(45)->setDistance(10); $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); @@ -189,7 +189,7 @@ public function testFillGradientLinearTable() $expected1 = 'E06B20'; $expected2 = strrev($expected1); - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oShape = $oSlide->createTableShape(1); $oShape->setHeight(200)->setWidth(600)->setOffsetX(150)->setOffsetY(300); @@ -210,14 +210,14 @@ public function testFillGradientLinearTable() } /** - * @link : https://github.com/PHPOffice/PHPPowerPoint/issues/61 + * @link : https://github.com/PHPOffice/PHPPresentation/issues/61 */ public function testFillGradientLinearRichText() { $expected1 = 'E06B20'; $expected2 = strrev($expected1); - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oShape = $oSlide->createRichTextShape(); $oShape->setHeight(200)->setWidth(600)->setOffsetX(150)->setOffsetY(300); @@ -239,7 +239,7 @@ public function testFillGradientPathTable() $expected1 = 'E06B20'; $expected2 = strrev($expected1); - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oShape = $oSlide->createTableShape(1); $oShape->setHeight(200)->setWidth(600)->setOffsetX(150)->setOffsetY(300); @@ -260,14 +260,14 @@ public function testFillGradientPathTable() } /** - * @link : https://github.com/PHPOffice/PHPPowerPoint/issues/61 + * @link : https://github.com/PHPOffice/PHPPresentation/issues/61 */ public function testFillGradientPathText() { $expected1 = 'E06B20'; $expected2 = strrev($expected1); - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oShape = $oSlide->createRichTextShape(); $oShape->setHeight(200)->setWidth(600)->setOffsetX(150)->setOffsetY(300); @@ -289,7 +289,7 @@ public function testFillPatternTable() $expected1 = 'E06B20'; $expected2 = strrev($expected1); - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oShape = $oSlide->createTableShape(1); $oShape->setHeight(200)->setWidth(600)->setOffsetX(150)->setOffsetY(300); @@ -313,7 +313,7 @@ public function testFillSolidTable() { $expected = 'E06B20'; - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oShape = $oSlide->createTableShape(1); $oShape->setHeight(200)->setWidth(600)->setOffsetX(150)->setOffsetY(300); @@ -331,13 +331,13 @@ public function testFillSolidTable() } /** - * @link : https://github.com/PHPOffice/PHPPowerPoint/issues/61 + * @link : https://github.com/PHPOffice/PHPPresentation/issues/61 */ public function testFillSolidText() { $expected = 'E06B20'; - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oShape = $oSlide->createRichTextShape(); $oShape->setHeight(200)->setWidth(600)->setOffsetX(150)->setOffsetY(300); @@ -353,7 +353,7 @@ public function testFillSolidText() public function testHyperlink() { - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRun = $oRichText->createTextRun('Delta'); @@ -367,7 +367,7 @@ public function testHyperlink() public function testHyperlinkInternal() { - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRun = $oRichText->createTextRun('Delta'); @@ -382,7 +382,7 @@ public function testHyperlinkInternal() public function testListBullet() { - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRichText->getActiveParagraph()->getBulletStyle()->setBulletType(Bullet::TYPE_BULLET); @@ -404,7 +404,7 @@ public function testListBullet() public function testListNumeric() { - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRichText->getActiveParagraph()->getBulletStyle()->setBulletType(Bullet::TYPE_NUMERIC); @@ -433,7 +433,7 @@ public function testLine() $valEmu10 = Drawing::pixelsToEmu(10); $valEmu90 = Drawing::pixelsToEmu(90); - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oSlide->createLineShape(10, 10, 100, 100); $oSlide->createLineShape(100, 10, 10, 100); @@ -458,13 +458,13 @@ public function testLine() public function testNote() { - $oPHPPowerPoint = new PhpPowerpoint(); - $oSlide = $oPHPPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oNote = $oSlide->getNote(); $oRichText = $oNote->createRichTextShape()->setHeight(300)->setWidth(600); $oRichText->createTextRun('testNote'); - $pres = TestHelperDOCX::getDocument($oPHPPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); // Content Types // $element = '/Types/Override[@PartName="/ppt/notesSlides/notesSlide1.xml"][@ContentType="application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml"]'; // $this->assertTrue($pres->elementExists($element, '[Content_Types].xml')); @@ -480,7 +480,7 @@ public function testNote() public function testRichTextAutoFitNormal() { - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRichText->setAutoFit(RichText::AUTOFIT_NORMAL, 47.5, 20); @@ -495,7 +495,7 @@ public function testRichTextAutoFitNormal() public function testRichTextBreak() { - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRichText->createBreak(); @@ -508,7 +508,7 @@ public function testRichTextBreak() public function testRichTextHyperlink() { - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRichText->getHyperLink()->setUrl('http://www.google.fr'); @@ -521,7 +521,7 @@ public function testRichTextHyperlink() public function testRichTextShadow() { - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRichText->createTextRun('AAA'); @@ -535,7 +535,7 @@ public function testRichTextShadow() public function testRichTextUpright() { - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRichText->createTextRun('AAA'); @@ -550,7 +550,7 @@ public function testRichTextUpright() public function testRichTextVertical() { - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRichText->createTextRun('AAA'); @@ -565,7 +565,7 @@ public function testRichTextVertical() public function testStyleSubScript() { - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRun = $oRichText->createTextRun('pText'); @@ -580,7 +580,7 @@ public function testStyleSubScript() public function testStyleSuperScript() { - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRun = $oRichText->createTextRun('pText'); @@ -595,7 +595,7 @@ public function testStyleSuperScript() public function testTableWithAlignment() { - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oShape = $oSlide->createTableShape(4); $oShape->setHeight(200)->setWidth(600)->setOffsetX(150)->setOffsetY(300); @@ -613,7 +613,7 @@ public function testTableWithAlignment() public function testTableWithBorder() { - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oShape = $oSlide->createTableShape(4); $oShape->setHeight(200)->setWidth(600)->setOffsetX(150)->setOffsetY(300); @@ -653,7 +653,7 @@ public function testTableWithBorder() public function testTableWithColspan() { - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oShape = $oSlide->createTableShape(4); $oShape->setHeight(200)->setWidth(600)->setOffsetX(150)->setOffsetY(300); @@ -671,7 +671,7 @@ public function testTableWithColspan() public function testTableWithRowspan() { - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oShape = $oSlide->createTableShape(4); $oShape->setHeight(200)->setWidth(600)->setOffsetX(150)->setOffsetY(300); @@ -692,11 +692,11 @@ public function testTableWithRowspan() } /** - * @link : https://github.com/PHPOffice/PHPPowerPoint/issues/70 + * @link : https://github.com/PHPOffice/PHPPresentation/issues/70 */ public function testTableWithHyperlink() { - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $oShape = $oSlide->createTableShape(4); $oShape->setHeight(200)->setWidth(600)->setOffsetX(150)->setOffsetY(300); @@ -704,7 +704,7 @@ public function testTableWithHyperlink() $oCell = $oRow->getCell(); $oTextRun = $oCell->createTextRun('AAA'); $oHyperlink = $oTextRun->getHyperlink(); - $oHyperlink->setUrl('https://github.com/PHPOffice/PHPPowerPoint/'); + $oHyperlink->setUrl('https://github.com/PHPOffice/PHPPresentation/'); $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); @@ -719,7 +719,7 @@ public function testTransition() $oTransition = new Transition(); - $phpPowerPoint = new PhpPowerpoint(); + $phpPowerPoint = new PhpPresentation(); $oSlide = $phpPowerPoint->getActiveSlide(); $element = '/p:sld/p:transition'; @@ -748,7 +748,7 @@ public function testTransition() $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); $this->assertContains('slow', $pres->getElementAttribute($element, 'spd', 'ppt/slides/slide1.xml')); - $rcTransition = new \ReflectionClass('PhpOffice\PhpPowerpoint\Slide\Transition'); + $rcTransition = new \ReflectionClass('PhpOffice\PhpPresentation\Slide\Transition'); $arrayConstants = $rcTransition->getConstants(); foreach ($arrayConstants as $key => $value) { if (strpos($key, 'TRANSITION_') !== 0) { diff --git a/tests/PhpPowerpoint/Tests/Writer/PowerPoint2007Test.php b/tests/PhpPresentation/Tests/Writer/PowerPoint2007Test.php similarity index 62% rename from tests/PhpPowerpoint/Tests/Writer/PowerPoint2007Test.php rename to tests/PhpPresentation/Tests/Writer/PowerPoint2007Test.php index 07921958b..8c0abf169 100644 --- a/tests/PhpPowerpoint/Tests/Writer/PowerPoint2007Test.php +++ b/tests/PhpPresentation/Tests/Writer/PowerPoint2007Test.php @@ -1,24 +1,24 @@ 'ContentTypes', 'docprops' => 'DocProps', @@ -44,16 +44,16 @@ public function testConstruct() 'chart' => 'Chart', ); - $phpPowerPoint = new PhpPowerpoint(); - $object = new PowerPoint2007($phpPowerPoint); + $oPhpPresentation = new PhpPresentation(); + $object = new PowerPoint2007($oPhpPresentation); - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\PhpPowerpoint', $object->getPhpPowerpoint()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $object->getPhpPresentation()); $this->assertEquals('./', $object->getDiskCachingDirectory()); $this->assertInstanceOf("{$objectPrefix}LayoutPack\\PackDefault", $object->getLayoutPack()); foreach ($parts as $partName => $objectName) { $this->assertInstanceOf($objectPrefix . $objectName, $object->getWriterPart($partName)); } - $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\HashTable', $object->getDrawingHashTable()); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\HashTable', $object->getDrawingHashTable()); } /** @@ -61,18 +61,18 @@ public function testConstruct() */ public function testSave() { - $filename = tempnam(sys_get_temp_dir(), 'PHPPowerPoint'); - $imageFile = PHPPOWERPOINT_TESTS_BASE_DIR . '/resources/images/PHPPowerPointLogo.png'; + $filename = tempnam(sys_get_temp_dir(), 'PhpPresentation'); + $imageFile = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/images/PhpPresentationLogo.png'; - $phpPowerPoint = new PhpPowerpoint(); - $slide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $slide = $oPhpPresentation->getActiveSlide(); $slide->createRichTextShape(); $slide->createLineShape(10, 10, 10, 10); - $slide->createChartShape()->getPlotArea()->setType(new \PhpOffice\PhpPowerpoint\Shape\Chart\Type\Bar3D()); + $slide->createChartShape()->getPlotArea()->setType(new \PhpOffice\PhpPresentation\Shape\Chart\Type\Bar3D()); $slide->createDrawingShape()->setName('Drawing')->setPath($imageFile); $slide->createTableShape()->createRow(); - $object = new PowerPoint2007($phpPowerPoint); + $object = new PowerPoint2007($oPhpPresentation); $object->save($filename); $this->assertTrue(file_exists($filename)); @@ -85,21 +85,21 @@ public function testSave() */ public function testGetWriterPartNull() { - $object = new PowerPoint2007(new PhpPowerpoint()); + $object = new PowerPoint2007(new PhpPresentation()); $this->assertNull($object->getWriterPart('foo')); } /** - * Test get PHPPowerPoint exception + * Test get PhpPresentation exception * * @expectedException Exception - * @expectedExceptionMessage No PHPPowerPoint assigned. + * @expectedExceptionMessage No PhpPresentation assigned. */ - public function testGetPHPPowerPointException() + public function testGetPhpPresentationException() { $object = new PowerPoint2007(); - $object->getPhpPowerpoint(); + $object->getPhpPresentation(); } /** @@ -107,7 +107,7 @@ public function testGetPHPPowerPointException() */ public function testSetHasOffice2003Compatibility() { - $object = new PowerPoint2007(new PhpPowerpoint()); + $object = new PowerPoint2007(new PhpPresentation()); $this->assertFalse($object->hasOffice2003Compatibility()); $object->setOffice2003Compatibility(true); @@ -119,7 +119,7 @@ public function testSetHasOffice2003Compatibility() */ public function testSetGetUseDiskCaching() { - $object = new PowerPoint2007(new PhpPowerpoint()); + $object = new PowerPoint2007(new PhpPresentation()); $this->assertFalse($object->hasDiskCaching()); $object->setUseDiskCaching(true, sys_get_temp_dir()); @@ -134,7 +134,7 @@ public function testSetGetUseDiskCaching() */ public function testSetUseDiskCachingException() { - $object = new PowerPoint2007(new PhpPowerpoint()); + $object = new PowerPoint2007(new PhpPresentation()); $object->setUseDiskCaching(true, 'foo'); } } diff --git a/tests/PhpPresentation/Tests/Writer/SerializedTest.php b/tests/PhpPresentation/Tests/Writer/SerializedTest.php new file mode 100644 index 000000000..1a50426cb --- /dev/null +++ b/tests/PhpPresentation/Tests/Writer/SerializedTest.php @@ -0,0 +1,109 @@ +assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $object->getPhpPresentation()); + } + + /** + * @expectedException \Exception + * @expectedExceptionMessage No PhpPresentation assigned. + */ + public function testEmptyConstruct() + { + $object = new Serialized(); + $object->getPhpPresentation(); + } + + /** + * @expectedException \Exception + * @expectedExceptionMessage Filename is empty. + */ + public function testSaveEmpty() + { + $object = new Serialized(new PhpPresentation()); + $object->save(''); + } + + /** + * @expectedException \Exception + * @expectedExceptionMessage PhpPresentation object unassigned. + */ + public function testSaveNoObject() + { + $object = new Serialized(); + $object->save('file.phpppt'); + } + + public function testSave() + { + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); + $oImage = $oSlide->createDrawingShape(); + $oImage->setPath(PHPPRESENTATION_TESTS_BASE_DIR.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'images'.DIRECTORY_SEPARATOR.'PhpPresentationLogo.png'); + $object = new Serialized($oPhpPresentation); + + $file = tempnam(sys_get_temp_dir(), 'PhpPresentation_Serialized'); + + $this->assertFileExists($file, $object->save($file)); + } + + /** + * @expectedException \Exception + * @expectedExceptionMessage Could not open + */ + public function testSaveNotExistingDir() + { + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); + $oImage = $oSlide->createDrawingShape(); + $oImage->setPath(PHPPRESENTATION_TESTS_BASE_DIR.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'images'.DIRECTORY_SEPARATOR.'PhpPresentationLogo.png'); + $object = new Serialized($oPhpPresentation); + + $file = tempnam(sys_get_temp_dir(), 'PhpPresentation_Serialized'); + + $this->assertFileExists($file, $object->save($file.DIRECTORY_SEPARATOR.'test'.DIRECTORY_SEPARATOR.'test')); + } + + public function testSaveOverwriting() + { + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); + $oImage = $oSlide->createDrawingShape(); + $oImage->setPath(PHPPRESENTATION_TESTS_BASE_DIR.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'images'.DIRECTORY_SEPARATOR.'PhpPresentationLogo.png'); + $object = new Serialized($oPhpPresentation); + + $file = tempnam(sys_get_temp_dir(), 'PhpPresentation_Serialized'); + file_put_contents($file, rand(1, 100)); + + $this->assertFileExists($file, $object->save($file)); + } +} diff --git a/tests/PhpPowerpoint/Tests/_includes/TestHelperDOCX.php b/tests/PhpPresentation/Tests/_includes/TestHelperDOCX.php similarity index 54% rename from tests/PhpPowerpoint/Tests/_includes/TestHelperDOCX.php rename to tests/PhpPresentation/Tests/_includes/TestHelperDOCX.php index 2ea7bbc5b..0910488c2 100644 --- a/tests/PhpPowerpoint/Tests/_includes/TestHelperDOCX.php +++ b/tests/PhpPresentation/Tests/_includes/TestHelperDOCX.php @@ -1,24 +1,24 @@ save(self::$file); $zip = new \ZipArchive; $res = $zip->open(self::$file); if ($res === true) { - $zip->extractTo(sys_get_temp_dir() . '/PhpPowerpoint_Unit_Test/'); + $zip->extractTo(sys_get_temp_dir() . '/PhpPresentation_Unit_Test/'); $zip->close(); } - return new XmlDocument(sys_get_temp_dir() . '/PhpPowerpoint_Unit_Test/'); + return new XmlDocument(sys_get_temp_dir() . '/PhpPresentation_Unit_Test/'); } /** @@ -67,8 +67,8 @@ public static function clear() if (file_exists(self::$file)) { unlink(self::$file); } - if (is_dir(sys_get_temp_dir() . '/PhpPowerpoint_Unit_Test/')) { - self::deleteDir(sys_get_temp_dir() . '/PhpPowerpoint_Unit_Test/'); + if (is_dir(sys_get_temp_dir() . '/PhpPresentation_Unit_Test/')) { + self::deleteDir(sys_get_temp_dir() . '/PhpPresentation_Unit_Test/'); } } diff --git a/tests/PhpPowerpoint/Tests/_includes/XmlDocument.php b/tests/PhpPresentation/Tests/_includes/XmlDocument.php similarity index 89% rename from tests/PhpPowerpoint/Tests/_includes/XmlDocument.php rename to tests/PhpPresentation/Tests/_includes/XmlDocument.php index 89b309086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9>l%y*ozAueOA@xuYd4*z^;QHexC)Tm(1dI_V}~r zI*X>bKSSrZ513&7e7SGyV~i{GaGvA?r(3d^U#H%4MLN1>SW78FKgxc&2-;6a`JvORby>TB78tl$K1Us`&hhk5a4;@uVa< zP0(*9cOCvxrWEsTtI1qYOW+Nk0mka8Qn=R=9rPD=w8SkyS6z6|KhwUrpxr;!6ZcyZ zUeVJW?nni>)LctMEOQ%V;?>duy(#$w^aJ<0$A3HI6N$<+Vfzr_VSlTQ`=HA8T?xAL zkb~a8x=S&k`-LP||2prtea9esGkCX??H+d7cPr09OMk?2Ov!fTs`cOd?h@nEVG^-> z6lF5+W%a#YqrPX)B^JXkdi{L`!aKKSAjft5-GJr@{1)#V9p^$~gLyigf#Z2qxHP1{ zU4I{qy}kqfZnD3E0Ha7hYLu_)=!uz`)zD{;I}x>K&4*d{$sW{m_8+DvaVl@nBe-RI zAtIj3dG;w@e;f;%(e>~h4o~S?cyE7)_bi*tb|23F|1{feru*yuGssyUySn!_IqX^- zcOq)n)`!{h0>=UxQ>;d_=_o@b)VgF3r++Tqy_j=nIUk}ioC)#xH;3dm8};w$bpN4* zJa_L37R3P#c8<<=GqQ(W_J?ZiPPcd?ZVX9^7UNvK+IXb7AxK6V(Pr}GbJ=Dt8<{-2VIDh=s zKt27<48}rwmg5;;Elhj(9RU430UrYvMPZ84liIfGY=G(HvY$j}C{2GyIK=TnfSgU} zpY6&^+uk34eEjg1{N($^hx1>Ve|+(8P)h*<000yK000O8=)2ZL!UEpH^Be#G?i>IB z8~^|S000000000000000003=eWRsOSB_Qa#) Date: Wed, 8 Jul 2015 14:02:53 +0200 Subject: [PATCH 04/15] PhpOffice\PhpPowerpoint becomes PhpOffice\PhpPresentation - GH-25 --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 7b61950df..ffb127fe0 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -40,7 +40,7 @@ master_doc = 'index' # General information about the project. -project = PhpPresentation' +project = 'PhpPresentation' copyright = u'2014, PHPPresentation Contributors' # The version info for the project you're documenting, acts as replacement for From 2f45ce0a92d3fe46fa882153367663738fe1963d Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Wed, 8 Jul 2015 14:05:43 +0200 Subject: [PATCH 05/15] PhpOffice\PhpPowerpoint becomes PhpOffice\PhpPresentation - GH-25 --- docs/faq.rst | 2 +- .../Tests/Writer/PowerPoint2007/SlideTest.php | 216 +++++++++--------- 2 files changed, 109 insertions(+), 109 deletions(-) diff --git a/docs/faq.rst b/docs/faq.rst index a00c82170..81b4bf895 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -50,5 +50,5 @@ the verbose class names will need to be updated accordingly. Why PHPPowerPoint become PHPPresentation ? ------------------------------------------ -As Roman Syroeshko noticed us, PowerPoint is a `trademark `__. +As `Roman Syroeshko noticed us `__, PowerPoint is a `trademark `__. For avoiding any problems with Microsoft, we decide to change the name to a more logic name, with our panel of readers/writers. \ No newline at end of file diff --git a/tests/PhpPresentation/Tests/Writer/PowerPoint2007/SlideTest.php b/tests/PhpPresentation/Tests/Writer/PowerPoint2007/SlideTest.php index b3a908726..5e31db44e 100644 --- a/tests/PhpPresentation/Tests/Writer/PowerPoint2007/SlideTest.php +++ b/tests/PhpPresentation/Tests/Writer/PowerPoint2007/SlideTest.php @@ -60,13 +60,13 @@ public function testConstructException() */ public function testAlignmentShapeAuto() { - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createRichTextShape()->setWidth(400)->setHeight(400)->setOffsetX(100)->setOffsetY(100); $oShape->createTextRun('this text should be vertically aligned'); $oShape->getActiveParagraph()->getAlignment()->setVertical(Alignment::VERTICAL_AUTO); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:bodyPr'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); $this->assertFalse($pres->attributeElementExists($element, 'anchor', 'ppt/slides/slide1.xml')); @@ -77,13 +77,13 @@ public function testAlignmentShapeAuto() */ public function testAlignmentShapeBase() { - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createRichTextShape()->setWidth(400)->setHeight(400)->setOffsetX(100)->setOffsetY(100); $oShape->createTextRun('this text should be vertically aligned'); $oShape->getActiveParagraph()->getAlignment()->setVertical(Alignment::VERTICAL_BASE); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:bodyPr'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); $this->assertFalse($pres->attributeElementExists($element, 'anchor', 'ppt/slides/slide1.xml')); @@ -94,13 +94,13 @@ public function testAlignmentShapeBase() */ public function testAlignmentShapeBottom() { - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createRichTextShape()->setWidth(400)->setHeight(400)->setOffsetX(100)->setOffsetY(100); $oShape->createTextRun('this text should be vertically aligned'); $oShape->getActiveParagraph()->getAlignment()->setVertical(Alignment::VERTICAL_BOTTOM); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:bodyPr'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); $this->assertEquals(Alignment::VERTICAL_BOTTOM, $pres->getElementAttribute($element, 'anchor', 'ppt/slides/slide1.xml')); @@ -111,13 +111,13 @@ public function testAlignmentShapeBottom() */ public function testAlignmentShapeCenter() { - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createRichTextShape()->setWidth(400)->setHeight(400)->setOffsetX(100)->setOffsetY(100); $oShape->createTextRun('this text should be vertically aligned'); $oShape->getActiveParagraph()->getAlignment()->setVertical(Alignment::VERTICAL_CENTER); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:bodyPr'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); $this->assertEquals(Alignment::VERTICAL_CENTER, $pres->getElementAttribute($element, 'anchor', 'ppt/slides/slide1.xml')); @@ -128,13 +128,13 @@ public function testAlignmentShapeCenter() */ public function testAlignmentShapeTop() { - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createRichTextShape()->setWidth(400)->setHeight(400)->setOffsetX(100)->setOffsetY(100); $oShape->createTextRun('this text should be vertically aligned'); $oShape->getActiveParagraph()->getAlignment()->setVertical(Alignment::VERTICAL_TOP); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:bodyPr'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); $this->assertEquals(Alignment::VERTICAL_TOP, $pres->getElementAttribute($element, 'anchor', 'ppt/slides/slide1.xml')); @@ -142,13 +142,13 @@ public function testAlignmentShapeTop() public function testDrawingWithHyperlink() { - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createDrawingShape(); $oShape->setPath(PHPPRESENTATION_TESTS_BASE_DIR.'/resources/images/PhpPresentationLogo.png'); $oShape->getHyperlink()->setUrl('https://github.com/PHPOffice/PHPPresentation/'); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:pic/p:nvPicPr/p:cNvPr/a:hlinkClick'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); @@ -157,13 +157,13 @@ public function testDrawingWithHyperlink() public function testDrawingShapeBorder() { - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createDrawingShape(); $oShape->setPath(PHPPRESENTATION_TESTS_BASE_DIR.'/resources/images/PhpPresentationLogo.png'); $oShape->getBorder()->setLineStyle(Border::LINE_DOUBLE); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:pic/p:spPr/a:ln'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); @@ -172,13 +172,13 @@ public function testDrawingShapeBorder() public function testDrawingShapeShadow() { - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createDrawingShape(); $oShape->setPath(PHPPRESENTATION_TESTS_BASE_DIR.'/resources/images/PhpPresentationLogo.png'); $oShape->getShadow()->setVisible(true)->setDirection(45)->setDistance(10); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:pic/p:spPr/a:effectLst/a:outerShdw'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); @@ -189,8 +189,8 @@ public function testFillGradientLinearTable() $expected1 = 'E06B20'; $expected2 = strrev($expected1); - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createTableShape(1); $oShape->setHeight(200)->setWidth(600)->setOffsetX(150)->setOffsetY(300); $oRow = $oShape->createRow(); @@ -199,7 +199,7 @@ public function testFillGradientLinearTable() $oFill = $oCell->getFill(); $oFill->setFillType(Fill::FILL_GRADIENT_LINEAR)->setStartColor(new Color('FF'.$expected1))->setEndColor(new Color('FF'.$expected2)); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/a:tbl/a:tr/a:tc/a:tcPr/a:gradFill/a:gsLst/a:gs[@pos="0"]/a:srgbClr'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); @@ -217,14 +217,14 @@ public function testFillGradientLinearRichText() $expected1 = 'E06B20'; $expected2 = strrev($expected1); - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createRichTextShape(); $oShape->setHeight(200)->setWidth(600)->setOffsetX(150)->setOffsetY(300); $oFill = $oShape->getFill(); $oFill->setFillType(Fill::FILL_GRADIENT_LINEAR)->setStartColor(new Color('FF'.$expected1))->setEndColor(new Color('FF'.$expected2)); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:gradFill/a:gsLst/a:gs[@pos="0"]/a:srgbClr'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); @@ -239,8 +239,8 @@ public function testFillGradientPathTable() $expected1 = 'E06B20'; $expected2 = strrev($expected1); - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createTableShape(1); $oShape->setHeight(200)->setWidth(600)->setOffsetX(150)->setOffsetY(300); $oRow = $oShape->createRow(); @@ -249,7 +249,7 @@ public function testFillGradientPathTable() $oFill = $oCell->getFill(); $oFill->setFillType(Fill::FILL_GRADIENT_PATH)->setStartColor(new Color('FF'.$expected1))->setEndColor(new Color('FF'.$expected2)); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/a:tbl/a:tr/a:tc/a:tcPr/a:gradFill/a:gsLst/a:gs[@pos="0"]/a:srgbClr'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); @@ -267,14 +267,14 @@ public function testFillGradientPathText() $expected1 = 'E06B20'; $expected2 = strrev($expected1); - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createRichTextShape(); $oShape->setHeight(200)->setWidth(600)->setOffsetX(150)->setOffsetY(300); $oFill = $oShape->getFill(); $oFill->setFillType(Fill::FILL_GRADIENT_PATH)->setStartColor(new Color('FF'.$expected1))->setEndColor(new Color('FF'.$expected2)); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:gradFill/a:gsLst/a:gs[@pos="0"]/a:srgbClr'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); @@ -289,8 +289,8 @@ public function testFillPatternTable() $expected1 = 'E06B20'; $expected2 = strrev($expected1); - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createTableShape(1); $oShape->setHeight(200)->setWidth(600)->setOffsetX(150)->setOffsetY(300); $oRow = $oShape->createRow(); @@ -299,7 +299,7 @@ public function testFillPatternTable() $oFill = $oCell->getFill(); $oFill->setFillType(Fill::FILL_PATTERN_LIGHTTRELLIS)->setStartColor(new Color('FF'.$expected1))->setEndColor(new Color('FF'.$expected2)); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/a:tbl/a:tr/a:tc/a:tcPr/a:pattFill/a:fgClr/a:srgbClr'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); @@ -313,8 +313,8 @@ public function testFillSolidTable() { $expected = 'E06B20'; - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createTableShape(1); $oShape->setHeight(200)->setWidth(600)->setOffsetX(150)->setOffsetY(300); $oRow = $oShape->createRow(); @@ -323,7 +323,7 @@ public function testFillSolidTable() $oFill = $oCell->getFill(); $oFill->setFillType(Fill::FILL_SOLID)->setStartColor(new Color('FF'.$expected)); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/a:tbl/a:tr/a:tc/a:tcPr/a:solidFill/a:srgbClr'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); @@ -337,14 +337,14 @@ public function testFillSolidText() { $expected = 'E06B20'; - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createRichTextShape(); $oShape->setHeight(200)->setWidth(600)->setOffsetX(150)->setOffsetY(300); $oFill = $oShape->getFill(); $oFill->setFillType(Fill::FILL_SOLID)->setStartColor(new Color('FF'.$expected)); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:solidFill/a:srgbClr'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); @@ -353,13 +353,13 @@ public function testFillSolidText() public function testHyperlink() { - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRun = $oRichText->createTextRun('Delta'); $oRun->getHyperlink()->setUrl('http://www.google.fr'); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:r/a:rPr/a:hlinkClick'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); @@ -367,13 +367,13 @@ public function testHyperlink() public function testHyperlinkInternal() { - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRun = $oRichText->createTextRun('Delta'); $oRun->getHyperlink()->setSlideNumber(1); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:r/a:rPr/a:hlinkClick'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); @@ -382,8 +382,8 @@ public function testHyperlinkInternal() public function testListBullet() { - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRichText->getActiveParagraph()->getBulletStyle()->setBulletType(Bullet::TYPE_BULLET); $oExpectedFont = $oRichText->getActiveParagraph()->getBulletStyle()->getBulletFont(); @@ -393,7 +393,7 @@ public function testListBullet() $oRichText->createParagraph()->createTextRun('Delta'); $oRichText->createParagraph()->createTextRun('Epsilon'); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:pPr'; $this->assertTrue($pres->elementExists($element.'/a:buFont', 'ppt/slides/slide1.xml')); @@ -404,8 +404,8 @@ public function testListBullet() public function testListNumeric() { - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRichText->getActiveParagraph()->getBulletStyle()->setBulletType(Bullet::TYPE_NUMERIC); $oRichText->getActiveParagraph()->getBulletStyle()->setBulletNumericStyle(Bullet::NUMERIC_EA1CHSPERIOD); @@ -418,7 +418,7 @@ public function testListNumeric() $oRichText->createParagraph()->createTextRun('Delta'); $oRichText->createParagraph()->createTextRun('Epsilon'); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:pPr'; $this->assertTrue($pres->elementExists($element.'/a:buFont', 'ppt/slides/slide1.xml')); @@ -433,14 +433,14 @@ public function testLine() $valEmu10 = Drawing::pixelsToEmu(10); $valEmu90 = Drawing::pixelsToEmu(90); - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oSlide->createLineShape(10, 10, 100, 100); $oSlide->createLineShape(100, 10, 10, 100); $oSlide->createLineShape(10, 100, 100, 10); $oSlide->createLineShape(100, 100, 10, 10); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:cxnSp/p:spPr/a:prstGeom'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); @@ -480,13 +480,13 @@ public function testNote() public function testRichTextAutoFitNormal() { - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRichText->setAutoFit(RichText::AUTOFIT_NORMAL, 47.5, 20); $oRichText->createTextRun('This is my text for the test.'); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:bodyPr/a:normAutofit'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); $this->assertEquals(47500, $pres->getElementAttribute($element, 'fontScale', 'ppt/slides/slide1.xml')); @@ -495,12 +495,12 @@ public function testRichTextAutoFitNormal() public function testRichTextBreak() { - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRichText->createBreak(); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:br'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); @@ -508,12 +508,12 @@ public function testRichTextBreak() public function testRichTextHyperlink() { - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRichText->getHyperLink()->setUrl('http://www.google.fr'); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:sp//a:hlinkClick'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); @@ -521,13 +521,13 @@ public function testRichTextHyperlink() public function testRichTextShadow() { - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRichText->createTextRun('AAA'); $oRichText->getShadow()->setVisible(true)->setAlpha(75)->setBlurRadius(2)->setDirection(45); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:effectLst/a:outerShdw'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); @@ -535,13 +535,13 @@ public function testRichTextShadow() public function testRichTextUpright() { - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRichText->createTextRun('AAA'); $oRichText->setUpright(true); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:bodyPr'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); @@ -550,13 +550,13 @@ public function testRichTextUpright() public function testRichTextVertical() { - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRichText->createTextRun('AAA'); $oRichText->setVertical(true); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:bodyPr'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); @@ -565,13 +565,13 @@ public function testRichTextVertical() public function testStyleSubScript() { - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRun = $oRichText->createTextRun('pText'); $oRun->getFont()->setSubScript(true); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:r/a:rPr'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); @@ -580,13 +580,13 @@ public function testStyleSubScript() public function testStyleSuperScript() { - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oRichText = $oSlide->createRichTextShape(); $oRun = $oRichText->createTextRun('pText'); $oRun->getFont()->setSuperScript(true); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:p/a:r/a:rPr'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); @@ -595,8 +595,8 @@ public function testStyleSuperScript() public function testTableWithAlignment() { - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createTableShape(4); $oShape->setHeight(200)->setWidth(600)->setOffsetX(150)->setOffsetY(300); $oRow = $oShape->createRow(); @@ -604,7 +604,7 @@ public function testTableWithAlignment() $oCell->createTextRun('AAA'); $oCell->getActiveParagraph()->getAlignment()->setVertical(Alignment::VERTICAL_BOTTOM); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/a:tbl/a:tr/a:tc/a:tcPr'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); @@ -613,8 +613,8 @@ public function testTableWithAlignment() public function testTableWithBorder() { - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createTableShape(4); $oShape->setHeight(200)->setWidth(600)->setOffsetX(150)->setOffsetY(300); $oRow = $oShape->createRow(); @@ -638,7 +638,7 @@ public function testTableWithBorder() $oCell->getBorders()->getBottom()->setDashStyle(Border::DASH_LARGEDASHDOTDOT); $oCell->getBorders()->getBottom()->setLineStyle(Border::LINE_NONE); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/a:tbl/a:tr/a:tc/a:tcPr'; $this->assertTrue($pres->elementExists($element.'/a:lnL[@cmpd="'.Border::LINE_THINTHICK.'"]', 'ppt/slides/slide1.xml')); @@ -653,8 +653,8 @@ public function testTableWithBorder() public function testTableWithColspan() { - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createTableShape(4); $oShape->setHeight(200)->setWidth(600)->setOffsetX(150)->setOffsetY(300); $oRow = $oShape->createRow(); @@ -662,7 +662,7 @@ public function testTableWithColspan() $oCell->createTextRun('AAA'); $oCell->setColSpan(2); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/a:tbl/a:tr/a:tc'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); @@ -671,8 +671,8 @@ public function testTableWithColspan() public function testTableWithRowspan() { - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createTableShape(4); $oShape->setHeight(200)->setWidth(600)->setOffsetX(150)->setOffsetY(300); $oRow = $oShape->createRow(); @@ -684,7 +684,7 @@ public function testTableWithRowspan() $oCell = $oRow->getCell(); $oCell->createTextRun('BBB'); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/a:tbl/a:tr/a:tc'; $this->assertTrue($pres->elementExists($element.'[@rowSpan="2"]', 'ppt/slides/slide1.xml')); @@ -696,8 +696,8 @@ public function testTableWithRowspan() */ public function testTableWithHyperlink() { - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $oShape = $oSlide->createTableShape(4); $oShape->setHeight(200)->setWidth(600)->setOffsetX(150)->setOffsetY(300); $oRow = $oShape->createRow(); @@ -706,7 +706,7 @@ public function testTableWithHyperlink() $oHyperlink = $oTextRun->getHyperlink(); $oHyperlink->setUrl('https://github.com/PHPOffice/PHPPresentation/'); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $element = '/p:sld/p:cSld/p:spTree/p:graphicFrame/a:graphic/a:graphicData/a:tbl/a:tr/a:tc/a:txBody/a:p/a:r/a:rPr/a:hlinkClick'; $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); @@ -719,33 +719,33 @@ public function testTransition() $oTransition = new Transition(); - $phpPowerPoint = new PhpPresentation(); - $oSlide = $phpPowerPoint->getActiveSlide(); + $oPhpPresentation = new PhpPresentation(); + $oSlide = $oPhpPresentation->getActiveSlide(); $element = '/p:sld/p:transition'; - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $this->assertFalse($pres->elementExists($element, 'ppt/slides/slide1.xml')); $oTransition->setTimeTrigger(true, $value); $oSlide->setTransition($oTransition); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $this->assertTrue($pres->elementExists($element, 'ppt/slides/slide1.xml')); $this->assertTrue($pres->attributeElementExists($element, 'advTm', 'ppt/slides/slide1.xml')); $this->assertEquals($value, $pres->getElementAttribute($element, 'advTm', 'ppt/slides/slide1.xml')); $this->assertContains('0', $pres->getElementAttribute($element, 'advClick', 'ppt/slides/slide1.xml')); $oTransition->setSpeed(Transition::SPEED_FAST); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $this->assertContains('fast', $pres->getElementAttribute($element, 'spd', 'ppt/slides/slide1.xml')); $oTransition->setSpeed(Transition::SPEED_MEDIUM); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $this->assertContains('med', $pres->getElementAttribute($element, 'spd', 'ppt/slides/slide1.xml')); $oTransition->setSpeed(Transition::SPEED_SLOW); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $this->assertContains('slow', $pres->getElementAttribute($element, 'spd', 'ppt/slides/slide1.xml')); $rcTransition = new \ReflectionClass('PhpOffice\PhpPresentation\Slide\Transition'); @@ -757,7 +757,7 @@ public function testTransition() $oTransition->setTransitionType($rcTransition->getConstant($key)); $oSlide->setTransition($oTransition); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); switch ($key) { case 'TRANSITION_BLINDS_HORIZONTAL': $this->assertTrue($pres->elementExists($element.'/p:blinds[@dir=\'horz\']', 'ppt/slides/slide1.xml')); @@ -907,7 +907,7 @@ public function testTransition() } $oTransition->setManualTrigger(true); - $pres = TestHelperDOCX::getDocument($phpPowerPoint, 'PowerPoint2007'); + $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007'); $this->assertContains('1', $pres->getElementAttribute($element, 'advClick', 'ppt/slides/slide1.xml')); } } From 98b9a3b0216fbe8cc5f67935b6e9b472f958c527 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Fri, 10 Jul 2015 12:28:07 +0200 Subject: [PATCH 06/15] Fixed the sample in Readme.md - GH-114 --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2293b7f8c..e8529f039 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,6 @@ Read more about PHPPresentation: - [Requirements](#requirements) - [Installation](#installation) - [Getting started](#getting-started) -- [Known issues](#known-issues) - [Contributing](#contributing) - [Developers' Documentation](http://phppowerpoint.readthedocs.org/) - [API Documentation](http://phpoffice.github.io/PHPPresentation/docs/master/) @@ -73,9 +72,18 @@ require_once 'path/to/PhpPresentation/src/PhpPresentation/Autoloader.php'; The following is a basic usage example of the PHPPresentation library. ```php +// with your own install require_once 'src/PhpPresentation/Autoloader.php'; \PhpOffice\PhpPresentation\Autoloader::register(); +// with Composer +require_once 'vendor/autoload.php'; + +use PhpOffice\PhpPresentation\PhpPowerpoint; +use PhpOffice\PhpPresentation\IOFactory; +use PhpOffice\PhpPresentation\Style\Color; +use PhpOffice\PhpPresentation\Style\Alignment; + $objPHPPowerPoint = new PhpPresentation(); // Create slide From c205a89b11af8a06cefa0044ceac3f857724e891 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Fri, 10 Jul 2015 12:41:25 +0200 Subject: [PATCH 07/15] Fixed the sample in Readme.md - GH-114 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7d73698f..5d326fa33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Features ### Bugfix +- Fixed the sample in Readme.md - @Progi1984 GH-114 ### Changes - PhpOffice\PhpPowerpoint becomes PhpOffice\PhpPresentation - @Progi1984 GH-25 From 02e6f629390d948ba5e999b6a4a5f2d6cc09bc5d Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Tue, 21 Jul 2015 13:40:05 +0200 Subject: [PATCH 08/15] PowerPoint2007 Reader : Initial Commit - GH-44 --- CHANGELOG.md | 1 + samples/Sample_12_Reader_PowerPoint2007.php | 25 + samples/Sample_12_Reader_PowerPoint97.php | 147 ------ samples/Sample_Header.php | 380 +++++++++++--- samples/resources/Sample_12.pptx | Bin 0 -> 60849 bytes src/PhpPresentation/IOFactory.php | 2 +- src/PhpPresentation/Reader/PowerPoint2007.php | 489 ++++++++++++++++++ src/PhpPresentation/Shape/RichText.php | 18 +- .../Tests/Reader/PowerPoint2007Test.php | 465 +++++++++++++++++ tests/resources/files/Sample_12.pptx | Bin 0 -> 60849 bytes 10 files changed, 1300 insertions(+), 227 deletions(-) create mode 100644 samples/Sample_12_Reader_PowerPoint2007.php create mode 100644 samples/resources/Sample_12.pptx create mode 100644 src/PhpPresentation/Reader/PowerPoint2007.php create mode 100644 tests/PhpPresentation/Tests/Reader/PowerPoint2007Test.php create mode 100644 tests/resources/files/Sample_12.pptx diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d326fa33..2123931ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## 0.5.0 - Not released ### Features +- PowerPoint2007 Reader : Initial Commit - @Progi1984 GH-44 ### Bugfix - Fixed the sample in Readme.md - @Progi1984 GH-114 diff --git a/samples/Sample_12_Reader_PowerPoint2007.php b/samples/Sample_12_Reader_PowerPoint2007.php new file mode 100644 index 000000000..074f0fad5 --- /dev/null +++ b/samples/Sample_12_Reader_PowerPoint2007.php @@ -0,0 +1,25 @@ +load('resources/Sample_12.pptx'); + +$oTree = new PhpPptTree($oPHPPresentation); +echo $oTree->display(); +if (!CLI) { + include_once 'Sample_Footer.php'; +} diff --git a/samples/Sample_12_Reader_PowerPoint97.php b/samples/Sample_12_Reader_PowerPoint97.php index f01576261..9db9f458c 100644 --- a/samples/Sample_12_Reader_PowerPoint97.php +++ b/samples/Sample_12_Reader_PowerPoint97.php @@ -15,153 +15,6 @@ use PhpOffice\PhpPresentation\Shape\RichText; use PhpOffice\PhpPresentation\Shape\Group; -class PhpPptTree { - protected $oPhpPresentation; - protected $htmlOutput; - - public function __construct(PhpPresentation $oPHPPpt) - { - $this->oPhpPresentation = $oPHPPpt; - } - - public function display() - { - $this->append('
        '); - $this->append('
        '); - $this->append('
        '); - $this->append('
        '); - $this->append('
          '); - $this->displayPhpPresentation($this->oPhpPresentation); - $this->append('
        '); - $this->append('
        '); - $this->append('
        '); - $this->append('
        '); - $this->displayPhpPresentationInfo($this->oPhpPresentation); - $this->append('
        '); - $this->append('
        '); - $this->append('
        '); - - return $this->htmlOutput; - } - - protected function append($sHTML) - { - $this->htmlOutput .= $sHTML; - } - - protected function displayPhpPresentation(PhpPresentation $oPHPPpt) - { - $this->append('
      • PhpPresentation'); - $this->append('
          '); - $this->append('
        • Info "PhpPresentation"
        • '); - foreach ($oPHPPpt->getAllSlides() as $oSlide) { - $this->append('
        • Slide'); - $this->append('
            '); - $this->append('
          • Info "Slide"
          • '); - foreach ($oSlide->getShapeCollection() as $oShape) { - if($oShape instanceof Group) { - $this->append('
          • Shape "Group"'); - $this->append('
              '); - // $this->append('
            • Info "Group"
            • '); - foreach ($oShape->getShapeCollection() as $oShapeChild) { - $this->displayShape($oShapeChild); - } - $this->append('
            '); - $this->append('
          • '); - } else { - $this->displayShape($oShape); - } - } - $this->append('
          '); - $this->append('
        • '); - } - $this->append('
        '); - $this->append('
      • '); - } - - protected function displayShape(AbstractShape $shape) - { - if($shape instanceof MemoryDrawing) { - $this->append('
      • Shape "MemoryDrawing"
      • '); - } elseif($shape instanceof RichText) { - $this->append('
      • Shape "RichText"
      • '); - } else { - var_export($shape); - } - } - - protected function displayPhpPresentationInfo(PhpPresentation $oPHPPpt) - { - $this->append('
        '); - $this->append('
        '); - $this->append('
        Number of slides
        '.$oPHPPpt->getSlideCount().'
        '); - $this->append('
        Document Layout Height
        '.$oPHPPpt->getLayout()->getCY(DocumentLayout::UNIT_MILLIMETER).' mm
        '); - $this->append('
        Document Layout Width
        '.$oPHPPpt->getLayout()->getCX(DocumentLayout::UNIT_MILLIMETER).' mm
        '); - $this->append('
        Properties : Category
        '.$oPHPPpt->getProperties()->getCategory().'
        '); - $this->append('
        Properties : Company
        '.$oPHPPpt->getProperties()->getCompany().'
        '); - $this->append('
        Properties : Created
        '.$oPHPPpt->getProperties()->getCreated().'
        '); - $this->append('
        Properties : Creator
        '.$oPHPPpt->getProperties()->getCreator().'
        '); - $this->append('
        Properties : Description
        '.$oPHPPpt->getProperties()->getDescription().'
        '); - $this->append('
        Properties : Keywords
        '.$oPHPPpt->getProperties()->getKeywords().'
        '); - $this->append('
        Properties : Last Modified By
        '.$oPHPPpt->getProperties()->getLastModifiedBy().'
        '); - $this->append('
        Properties : Modified
        '.$oPHPPpt->getProperties()->getModified().'
        '); - $this->append('
        Properties : Subject
        '.$oPHPPpt->getProperties()->getSubject().'
        '); - $this->append('
        Properties : Title
        '.$oPHPPpt->getProperties()->getTitle().'
        '); - $this->append('
        '); - $this->append('
        '); - - foreach ($oPHPPpt->getAllSlides() as $oSlide) { - $this->append('
        '); - $this->append('
        '); - $this->append('
        HashCode
        '.$oSlide->getHashCode().'
        '); - $this->append('
        Slide Layout
        '.$oSlide->getSlideLayout().'
        '); - $this->append('
        Offset X
        '.$oSlide->getOffsetX().'
        '); - $this->append('
        Offset Y
        '.$oSlide->getOffsetY().'
        '); - $this->append('
        Extent X
        '.$oSlide->getExtentX().'
        '); - $this->append('
        Extent Y
        '.$oSlide->getExtentY().'
        '); - $this->append('
        '); - $this->append('
        '); - - foreach ($oSlide->getShapeCollection() as $oShape) { - if($oShape instanceof Group) { - foreach ($oShape->getShapeCollection() as $oShapeChild) { - $this->displayShapeInfo($oShapeChild); - } - } else { - $this->displayShapeInfo($oShape); - } - } - } - } - - protected function displayShapeInfo(AbstractShape $oShape) - { - $this->append('
        '); - $this->append('
        '); - $this->append('
        HashCode
        '.$oShape->getHashCode().'
        '); - $this->append('
        Offset X
        '.$oShape->getOffsetX().'
        '); - $this->append('
        Offset Y
        '.$oShape->getOffsetY().'
        '); - $this->append('
        Height
        '.$oShape->getHeight().'
        '); - $this->append('
        Width
        '.$oShape->getWidth().'
        '); - $this->append('
        Rotation
        '.$oShape->getRotation().'°
        '); - $this->append('
        Hyperlink
        '.ucfirst(var_export($oShape->hasHyperlink(), true)).'
        '); - $this->append('
        Fill
        @Todo
        '); - $this->append('
        Border
        @Todo
        '); - if($oShape instanceof MemoryDrawing) { - ob_start(); - call_user_func($oShape->getRenderingFunction(), $oShape->getImageResource()); - $sShapeImgContents = ob_get_contents(); - ob_end_clean(); - $this->append('
        Mime-Type
        '.$oShape->getMimeType().'
        '); - $this->append('
        Image
        '); - } else { - // Add another shape - } - $this->append('
        '); - $this->append('
        '); - } -} - $pptReader = PhpOffice\PhpPresentation\IOFactory::createReader('PowerPoint97'); $oPHPPresentation = $pptReader->load('resources/Sample_12.ppt'); diff --git a/samples/Sample_Header.php b/samples/Sample_Header.php index 5feac1dd3..2025141c4 100644 --- a/samples/Sample_Header.php +++ b/samples/Sample_Header.php @@ -6,6 +6,15 @@ use PhpOffice\PhpPresentation\Settings; use PhpOffice\PhpPresentation\IOFactory; use PhpOffice\PhpPresentation\Slide; +use PhpOffice\PhpPresentation\PhpPresentation; +use PhpOffice\PhpPresentation\AbstractShape; +use PhpOffice\PhpPresentation\DocumentLayout; +use PhpOffice\PhpPresentation\Shape\Drawing; +use PhpOffice\PhpPresentation\Shape\MemoryDrawing; +use PhpOffice\PhpPresentation\Shape\RichText; +use PhpOffice\PhpPresentation\Shape\RichText\BreakElement; +use PhpOffice\PhpPresentation\Shape\RichText\TextElement; +use PhpOffice\PhpPresentation\Style\Bullet; error_reporting(E_ALL); define('CLI', (PHP_SAPI == 'cli') ? true : false); @@ -23,7 +32,7 @@ // Return to the caller script when runs by CLI if (CLI) { - return; + return; } // Set titles and names @@ -35,13 +44,13 @@ // Populate samples $files = ''; if ($handle = opendir('.')) { - while (false !== ($file = readdir($handle))) { - if (preg_match('/^Sample_\d+_/', $file)) { - $name = str_replace('_', ' ', preg_replace('/(Sample_|\.php)/', '', $file)); - $files .= "
      • {$name}
      • "; - } - } - closedir($handle); + while (false !== ($file = readdir($handle))) { + if (preg_match('/^Sample_\d+_/', $file)) { + $name = str_replace('_', ' ', preg_replace('/(Sample_|\.php)/', '', $file)); + $files .= "
      • {$name}
      • "; + } + } + closedir($handle); } /** @@ -53,24 +62,24 @@ */ function write($phpPresentation, $filename, $writers) { - $result = ''; - - // Write documents - foreach ($writers as $writer => $extension) { - $result .= date('H:i:s') . " Write to {$writer} format"; - if (!is_null($extension)) { - $xmlWriter = IOFactory::createWriter($phpPresentation, $writer); - $xmlWriter->save(__DIR__ . "/{$filename}.{$extension}"); - rename(__DIR__ . "/{$filename}.{$extension}", __DIR__ . "/results/{$filename}.{$extension}"); - } else { - $result .= ' ... NOT DONE!'; - } - $result .= EOL; - } - - $result .= getEndingNotes($writers); - - return $result; + $result = ''; + + // Write documents + foreach ($writers as $writer => $extension) { + $result .= date('H:i:s') . " Write to {$writer} format"; + if (!is_null($extension)) { + $xmlWriter = IOFactory::createWriter($phpPresentation, $writer); + $xmlWriter->save(__DIR__ . "/{$filename}.{$extension}"); + rename(__DIR__ . "/{$filename}.{$extension}", __DIR__ . "/results/{$filename}.{$extension}"); + } else { + $result .= ' ... NOT DONE!'; + } + $result .= EOL; + } + + $result .= getEndingNotes($writers); + + return $result; } /** @@ -80,35 +89,35 @@ function write($phpPresentation, $filename, $writers) */ function getEndingNotes($writers) { - $result = ''; - - // Do not show execution time for index - if (!IS_INDEX) { - $result .= date('H:i:s') . " Done writing file(s)" . EOL; - $result .= date('H:i:s') . " Peak memory usage: " . (memory_get_peak_usage(true) / 1024 / 1024) . " MB" . EOL; - } - - // Return - if (CLI) { - $result .= 'The results are stored in the "results" subdirectory.' . EOL; - } else { - if (!IS_INDEX) { - $types = array_values($writers); - $result .= '

         

        '; - $result .= '

        Results: '; - foreach ($types as $type) { - if (!is_null($type)) { - $resultFile = 'results/' . SCRIPT_FILENAME . '.' . $type; - if (file_exists($resultFile)) { - $result .= "{$type} "; - } - } - } - $result .= '

        '; - } - } - - return $result; + $result = ''; + + // Do not show execution time for index + if (!IS_INDEX) { + $result .= date('H:i:s') . " Done writing file(s)" . EOL; + $result .= date('H:i:s') . " Peak memory usage: " . (memory_get_peak_usage(true) / 1024 / 1024) . " MB" . EOL; + } + + // Return + if (CLI) { + $result .= 'The results are stored in the "results" subdirectory.' . EOL; + } else { + if (!IS_INDEX) { + $types = array_values($writers); + $result .= '

         

        '; + $result .= '

        Results: '; + foreach ($types as $type) { + if (!is_null($type)) { + $resultFile = 'results/' . SCRIPT_FILENAME . '.' . $type; + if (file_exists($resultFile)) { + $result .= "{$type} "; + } + } + } + $result .= '

        '; + } + } + + return $result; } /** @@ -119,23 +128,250 @@ function getEndingNotes($writers) */ function createTemplatedSlide(PhpOffice\PhpPresentation\PhpPresentation $objPHPPresentation) { - // Create slide - $slide = $objPHPPresentation->createSlide(); - - // Add logo - $shape = $slide->createDrawingShape(); - $shape->setName('PHPPresentation logo') - ->setDescription('PHPPresentation logo') - ->setPath('./resources/phppowerpoint_logo.gif') - ->setHeight(36) - ->setOffsetX(10) - ->setOffsetY(10); - $shape->getShadow()->setVisible(true) - ->setDirection(45) - ->setDistance(10); - - // Return slide - return $slide; + // Create slide + $slide = $objPHPPresentation->createSlide(); + + // Add logo + $shape = $slide->createDrawingShape(); + $shape->setName('PHPPresentation logo') + ->setDescription('PHPPresentation logo') + ->setPath('./resources/phppowerpoint_logo.gif') + ->setHeight(36) + ->setOffsetX(10) + ->setOffsetY(10); + $shape->getShadow()->setVisible(true) + ->setDirection(45) + ->setDistance(10); + + // Return slide + return $slide; +} + +class PhpPptTree { + protected $oPhpPresentation; + protected $htmlOutput; + + public function __construct(PhpPresentation $oPHPPpt) + { + $this->oPhpPresentation = $oPHPPpt; + } + + public function display() + { + $this->append('
        '); + $this->append('
        '); + $this->append('
        '); + $this->append('
        '); + $this->append('
          '); + $this->displayPhpPresentation($this->oPhpPresentation); + $this->append('
        '); + $this->append('
        '); + $this->append('
        '); + $this->append('
        '); + $this->displayPhpPresentationInfo($this->oPhpPresentation); + $this->append('
        '); + $this->append('
        '); + $this->append('
        '); + + return $this->htmlOutput; + } + + protected function append($sHTML) + { + $this->htmlOutput .= $sHTML; + } + + protected function displayPhpPresentation(PhpPresentation $oPHPPpt) + { + $this->append('
      • PhpPresentation'); + $this->append('
          '); + $this->append('
        • Info "PhpPresentation"
        • '); + foreach ($oPHPPpt->getAllSlides() as $oSlide) { + $this->append('
        • Slide'); + $this->append('
            '); + $this->append('
          • Info "Slide"
          • '); + foreach ($oSlide->getShapeCollection() as $oShape) { + if($oShape instanceof Group) { + $this->append('
          • Shape "Group"'); + $this->append('
              '); + // $this->append('
            • Info "Group"
            • '); + foreach ($oShape->getShapeCollection() as $oShapeChild) { + $this->displayShape($oShapeChild); + } + $this->append('
            '); + $this->append('
          • '); + } else { + $this->displayShape($oShape); + } + } + $this->append('
          '); + $this->append('
        • '); + } + $this->append('
        '); + $this->append('
      • '); + } + + protected function displayShape(AbstractShape $shape) + { + if($shape instanceof MemoryDrawing) { + $this->append('
      • Shape "MemoryDrawing"
      • '); + } elseif($shape instanceof Drawing) { + $this->append('
      • Shape "Drawing"
      • '); + } elseif($shape instanceof RichText) { + $this->append('
      • Shape "RichText"
      • '); + } else { + var_export($shape); + } + } + + protected function displayPhpPresentationInfo(PhpPresentation $oPHPPpt) + { + $this->append('
        '); + $this->append('
        '); + $this->append('
        Number of slides
        '.$oPHPPpt->getSlideCount().'
        '); + $this->append('
        Document Layout Height
        '.$oPHPPpt->getLayout()->getCY(DocumentLayout::UNIT_MILLIMETER).' mm
        '); + $this->append('
        Document Layout Width
        '.$oPHPPpt->getLayout()->getCX(DocumentLayout::UNIT_MILLIMETER).' mm
        '); + $this->append('
        Properties : Category
        '.$oPHPPpt->getProperties()->getCategory().'
        '); + $this->append('
        Properties : Company
        '.$oPHPPpt->getProperties()->getCompany().'
        '); + $this->append('
        Properties : Created
        '.$oPHPPpt->getProperties()->getCreated().'
        '); + $this->append('
        Properties : Creator
        '.$oPHPPpt->getProperties()->getCreator().'
        '); + $this->append('
        Properties : Description
        '.$oPHPPpt->getProperties()->getDescription().'
        '); + $this->append('
        Properties : Keywords
        '.$oPHPPpt->getProperties()->getKeywords().'
        '); + $this->append('
        Properties : Last Modified By
        '.$oPHPPpt->getProperties()->getLastModifiedBy().'
        '); + $this->append('
        Properties : Modified
        '.$oPHPPpt->getProperties()->getModified().'
        '); + $this->append('
        Properties : Subject
        '.$oPHPPpt->getProperties()->getSubject().'
        '); + $this->append('
        Properties : Title
        '.$oPHPPpt->getProperties()->getTitle().'
        '); + $this->append('
        '); + $this->append('
        '); + + foreach ($oPHPPpt->getAllSlides() as $oSlide) { + $this->append('
        '); + $this->append('
        '); + $this->append('
        HashCode
        '.$oSlide->getHashCode().'
        '); + $this->append('
        Slide Layout
        Layout::'.$this->getConstantName('\PhpOffice\PhpPresentation\Slide\Layout', $oSlide->getSlideLayout()).'
        '); + + $this->append('
        Offset X
        '.$oSlide->getOffsetX().'
        '); + $this->append('
        Offset Y
        '.$oSlide->getOffsetY().'
        '); + $this->append('
        Extent X
        '.$oSlide->getExtentX().'
        '); + $this->append('
        Extent Y
        '.$oSlide->getExtentY().'
        '); + $this->append('
        '); + $this->append('
        '); + + foreach ($oSlide->getShapeCollection() as $oShape) { + if($oShape instanceof Group) { + foreach ($oShape->getShapeCollection() as $oShapeChild) { + $this->displayShapeInfo($oShapeChild); + } + } else { + $this->displayShapeInfo($oShape); + } + } + } + } + + protected function displayShapeInfo(AbstractShape $oShape) + { + $this->append('
        '); + $this->append('
        '); + $this->append('
        HashCode
        '.$oShape->getHashCode().'
        '); + $this->append('
        Offset X
        '.$oShape->getOffsetX().'
        '); + $this->append('
        Offset Y
        '.$oShape->getOffsetY().'
        '); + $this->append('
        Height
        '.$oShape->getHeight().'
        '); + $this->append('
        Width
        '.$oShape->getWidth().'
        '); + $this->append('
        Rotation
        '.$oShape->getRotation().'°
        '); + $this->append('
        Hyperlink
        '.ucfirst(var_export($oShape->hasHyperlink(), true)).'
        '); + $this->append('
        Fill
        @Todo
        '); + $this->append('
        Border
        @Todo
        '); + if($oShape instanceof MemoryDrawing) { + $this->append('
        Name
        '.$oShape->getName().'
        '); + $this->append('
        Description
        '.$oShape->getDescription().'
        '); + ob_start(); + call_user_func($oShape->getRenderingFunction(), $oShape->getImageResource()); + $sShapeImgContents = ob_get_contents(); + ob_end_clean(); + $this->append('
        Mime-Type
        '.$oShape->getMimeType().'
        '); + $this->append('
        Image
        '); + } elseif($oShape instanceof Drawing) { + $this->append('
        Name
        '.$oShape->getName().'
        '); + $this->append('
        Description
        '.$oShape->getDescription().'
        '); + } elseif($oShape instanceof RichText) { + $this->append('
        # of paragraphs
        '.count($oShape->getParagraphs()).'
        '); + $this->append('
        Inset (T / R / B / L)
        '.$oShape->getInsetTop().'px / '.$oShape->getInsetRight().'px / '.$oShape->getInsetBottom().'px / '.$oShape->getInsetLeft().'px
        '); + $this->append('
        Text
        '); + $this->append('
        '); + foreach ($oShape->getParagraphs() as $oParagraph) { + $this->append('Paragraph
        '); + $this->append('
        Alignment Horizontal
        Alignment::'.$this->getConstantName('\PhpOffice\PhpPresentation\Style\Alignment', $oParagraph->getAlignment()->getHorizontal()).'
        '); + $this->append('
        Alignment Vertical
        Alignment::'.$this->getConstantName('\PhpOffice\PhpPresentation\Style\Alignment', $oParagraph->getAlignment()->getVertical()).'
        '); + $this->append('
        Alignment Margin (L / R)
        '.$oParagraph->getAlignment()->getMarginLeft().' px / '.$oParagraph->getAlignment()->getMarginRight().'px
        '); + $this->append('
        Alignment Indent
        '.$oParagraph->getAlignment()->getIndent().' px
        '); + $this->append('
        Alignment Level
        '.$oParagraph->getAlignment()->getLevel().'
        '); + $this->append('
        Bullet Style
        Bullet::'.$this->getConstantName('\PhpOffice\PhpPresentation\Style\Bullet', $oParagraph->getBulletStyle()->getBulletType()).'
        '); + $this->append('
        Bullet Font
        '.$oParagraph->getBulletStyle()->getBulletFont().'
        '); + if ($oParagraph->getBulletStyle()->getBulletType() == Bullet::TYPE_BULLET) { + $this->append('
        Bullet Char
        '.$oParagraph->getBulletStyle()->getBulletChar().'
        '); + } + if ($oParagraph->getBulletStyle()->getBulletType() == Bullet::TYPE_NUMERIC) { + $this->append('
        Bullet Start At
        '.$oParagraph->getBulletStyle()->getBulletNumericStartAt().'
        '); + $this->append('
        Bullet Style
        '.$oParagraph->getBulletStyle()->getBulletNumericStyle().'
        '); + } + $this->append('
        RichText
        '); + foreach ($oParagraph->getRichTextElements() as $oRichText) { + if($oRichText instanceof BreakElement) { + $this->append('
        Break
        '); + } else { + if ($oRichText instanceof TextElement) { + $this->append('
        TextElement
        '); + } else { + $this->append('
        Run
        '); + } + $this->append('
        '.$oRichText->getText()); + $this->append('
        '); + $this->append('
        Font Name
        '.$oRichText->getFont()->getName().'
        '); + $this->append('
        Font Size
        '.$oRichText->getFont()->getSize().'
        '); + $this->append('
        Font Color
        #'.$oRichText->getFont()->getColor()->getARGB().'
        '); + $this->append('
        Font Transform
        '); + $this->append('Bold : '.($oRichText->getFont()->isBold() ? 'Y' : 'N').' - '); + $this->append('Italic : '.($oRichText->getFont()->isItalic() ? 'Y' : 'N').' - '); + $this->append('Underline : Underline::'.$this->getConstantName('\PhpOffice\PhpPresentation\Style\Font', $oRichText->getFont()->getUnderline()).' - '); + $this->append('Strikethrough : '.($oRichText->getFont()->isStrikethrough() ? 'Y' : 'N').' - '); + $this->append('SubScript : '.($oRichText->getFont()->isSubScript() ? 'Y' : 'N').' - '); + $this->append('SuperScript : '.($oRichText->getFont()->isSuperScript() ? 'Y' : 'N')); + $this->append('
        '); + if ($oRichText instanceof TextElement) { + if ($oRichText->hasHyperlink()) { + $this->append('
        Hyperlink URL
        '.$oRichText->getHyperlink()->getUrl().'
        '); + $this->append('
        Hyperlink Tooltip
        '.$oRichText->getHyperlink()->getTooltip().'
        '); + } + } + $this->append('
        '); + $this->append('
        '); + } + } + $this->append('
        '); + } + $this->append('
        '); + } else { + // Add another shape + } + $this->append('
        '); + $this->append('
        '); + } + + protected function getConstantName($class, $search, $startWith = '') { + $fooClass = new ReflectionClass($class); + $constants = $fooClass->getConstants(); + $constName = null; + foreach ($constants as $key => $value ) { + if ($value == $search) { + if (empty($startWith) || (!empty($startWith) && strpos($key, $startWith) === 0)) { + $constName = $key; + } + break; + } + } + return $constName; + } } ?> <?php echo $pageTitle; ?> diff --git a/samples/resources/Sample_12.pptx b/samples/resources/Sample_12.pptx new file mode 100644 index 0000000000000000000000000000000000000000..18fe0d0e71f565bcb3851f0f6797042d37645da8 GIT binary patch literal 60849 zcmdqJQ*>tAw!aBg_;l~dszqMaK&kNj8lIzV9ly3pjy#a`#jEYdi?aYQgUSal`<$$}9 zL;={4#3nl*%|MX0p6unzjo{!4XE3pffRlYEr3svpYI)(8-W`&2(c2J4&4!neVzp)5 zcS8z6rNk;23>7cWT_zcF1Ze14(3mR|2N!zhrj>t(zg3s`#()JVW@DZ6zjndnTF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OFactory.php index 6683f5687..a0741885c 100644 --- a/src/PhpPresentation/IOFactory.php +++ b/src/PhpPresentation/IOFactory.php @@ -27,7 +27,7 @@ class IOFactory * * @var array */ - private static $autoResolveClasses = array('Serialized'); + private static $autoResolveClasses = array('Serialized', 'PowerPoint97', 'PowerPoint2007'); /** * Create writer diff --git a/src/PhpPresentation/Reader/PowerPoint2007.php b/src/PhpPresentation/Reader/PowerPoint2007.php new file mode 100644 index 000000000..2e7c14b2f --- /dev/null +++ b/src/PhpPresentation/Reader/PowerPoint2007.php @@ -0,0 +1,489 @@ +fileSupportsUnserializePhpPresentation($pFilename); + } + + /** + * Does a file support UnserializePhpPresentation ? + * + * @param string $pFilename + * @throws \Exception + * @return boolean + */ + public function fileSupportsUnserializePhpPresentation($pFilename = '') + { + // Check if file exists + if (!file_exists($pFilename)) { + throw new \Exception("Could not open " . $pFilename . " for reading! File does not exist."); + } + + $oZip = new ZipArchive(); + // Is it a zip ? + if ($oZip->open($pFilename) === true) { + // Is it an OpenXML Document ? + // Is it a Presentation ? + if (is_array($oZip->statName('[Content_Types].xml')) && is_array($oZip->statName('ppt/presentation.xml'))) { + return true; + } + } + return false; + } + + /** + * Loads PhpPresentation Serialized file + * + * @param string $pFilename + * @return \PhpOffice\PhpPresentation\PhpPresentation + * @throws \Exception + */ + public function load($pFilename) + { + // Unserialize... First make sure the file supports it! + if (!$this->fileSupportsUnserializePhpPresentation($pFilename)) { + throw new \Exception("Invalid file format for PhpOffice\PhpPresentation\Reader\PowerPoint2007: " . $pFilename . "."); + } + + return $this->loadFile($pFilename); + } + + /** + * Load PhpPresentation Serialized file + * + * @param string $pFilename + * @return \PhpOffice\PhpPresentation\PhpPresentation + */ + protected function loadFile($pFilename) + { + $this->oPhpPresentation = new PhpPresentation(); + $this->oPhpPresentation->removeSlideByIndex(); + + $this->oZip = new ZipArchive(); + $this->oZip->open($pFilename); + $docPropsCore = $this->oZip->getFromName('docProps/core.xml'); + if ($docPropsCore !== false) { + $this->loadDocumentProperties($docPropsCore); + } + + $pptPresentation = $this->oZip->getFromName('ppt/presentation.xml'); + if ($pptPresentation !== false) { + $this->loadSlides($pptPresentation); + } + + return $this->oPhpPresentation; + } + + /** + * Read Document Properties + * @param string $sPart + * @return boolean + */ + protected function loadDocumentProperties($sPart) + { + $xmlReader = new XMLReader(); + if ($xmlReader->getDomFromString($sPart)) { + $arrayProperties = array( + '/cp:coreProperties/dc:creator' => 'setCreator', + '/cp:coreProperties/cp:lastModifiedBy' => 'setLastModifiedBy', + '/cp:coreProperties/dc:title' => 'setTitle', + '/cp:coreProperties/dc:description' => 'setDescription', + '/cp:coreProperties/dc:subject' => 'setSubject', + '/cp:coreProperties/cp:keywords' => 'setKeywords', + '/cp:coreProperties/cp:category' => 'setCategory', + '/cp:coreProperties/dcterms:created' => 'setCreated', + '/cp:coreProperties/dcterms:modified' => 'setModified', + ); + $oProperties = $this->oPhpPresentation->getProperties(); + foreach ($arrayProperties as $path => $property) { + if (is_object($oElement = $xmlReader->getElement($path))) { + if($oElement->hasAttribute('xsi:type') && $oElement->getAttribute('xsi:type') == 'dcterms:W3CDTF') { + $oDateTime = new \DateTime(); + $oDateTime->createFromFormat(\DateTime::W3C, $oElement->nodeValue); + $oProperties->{$property}($oDateTime->getTimestamp()); + } else { + $oProperties->{$property}($oElement->nodeValue); + } + } + } + } + return true; + } + + /** + * Extract all slides + */ + protected function loadSlides($sPart) + { + $xmlReader = new XMLReader(); + if ($xmlReader->getDomFromString($sPart)) { + $fileRels = 'ppt/_rels/presentation.xml.rels'; + $this->loadRels($fileRels); + foreach ($xmlReader->getElements('/p:presentation/p:sldIdLst/p:sldId') as $oElement) { + $rId = $oElement->getAttribute('r:id'); + $pathSlide = isset($this->arrayRels[$fileRels][$rId]) ? $this->arrayRels[$fileRels][$rId] : ''; + if (!empty($pathSlide)) { + $pptSlide = $this->oZip->getFromName('ppt/'.$pathSlide); + if ($pptSlide !== false) { + $this->loadRels('ppt/slides/_rels/'.basename($pathSlide).'.rels'); + $this->loadSlide($pptSlide, basename($pathSlide)); + } + } + } + } + return true; + } + + /** + * Extract data from slide + */ + protected function loadSlide($sPart, $baseFile) + { + $xmlReader = new XMLReader(); + if ($xmlReader->getDomFromString($sPart)) { + // Core + $this->oPhpPresentation->createSlide(); + $this->oPhpPresentation->setActiveSlideIndex($this->oPhpPresentation->getSlideCount() - 1); + foreach ($xmlReader->getElements('/p:sld/p:cSld/p:spTree/*') as $oNode) { + switch ($oNode->tagName) { + case 'p:pic': + $this->loadShapeDrawing($xmlReader, $oNode, $baseFile); + break; + case 'p:sp': + $this->loadShapeRichText($xmlReader, $oNode, $baseFile); + break; + default: + //var_export($oNode->tagName); + } + } + //die(); + } + return true; + } + + /** + * + * @param XMLReader $document + * @param \DOMElement $node + * @param string $baseFile + */ + protected function loadShapeDrawing(XMLReader $document, \DOMElement $node, $baseFile) + { + // Core + $oShape = new MemoryDrawing(); + $oShape->getShadow()->setVisible(false); + // Variables + $fileRels = 'ppt/slides/_rels/'.$baseFile.'.rels'; + + $oElement = $document->getElement('p:nvPicPr/p:cNvPr', $node); + if($oElement) { + $oShape->setName($oElement->hasAttribute('name') ? $oElement->getAttribute('name') : ''); + $oShape->setDescription($oElement->hasAttribute('descr') ? $oElement->getAttribute('descr') : ''); + } + + $oElement = $document->getElement('p:blipFill/a:blip', $node); + if ($oElement) { + if ($oElement->hasAttribute('r:embed') && isset($this->arrayRels[$fileRels][$oElement->getAttribute('r:embed')])) { + $pathImage = 'ppt/slides/'.$this->arrayRels[$fileRels][$oElement->getAttribute('r:embed')]; + $pathImage = explode('/', $pathImage); + foreach ($pathImage as $key => $partPath) { + if($partPath == '..') { + unset($pathImage[$key - 1]); + unset($pathImage[$key]); + } + } + $pathImage = implode('/', $pathImage); + $imageFile = $this->oZip->getFromName($pathImage); + if (!empty($imageFile)) { + $oShape->setImageResource(imagecreatefromstring($imageFile)); + } + } + } + + $oElement = $document->getElement('p:spPr/a:xfrm', $node); + if ($oElement) { + if ($oElement->hasAttribute('rot')) { + $oShape->setRotation(CommonDrawing::angleToDegrees($oElement->getAttribute('rot'))); + } + } + + $oElement = $document->getElement('p:spPr/a:xfrm/a:off', $node); + if ($oElement) { + if ($oElement->hasAttribute('x')) { + $oShape->setOffsetX(CommonDrawing::emuToPixels($oElement->getAttribute('x'))); + } + if ($oElement->hasAttribute('y')) { + $oShape->setOffsetY(CommonDrawing::emuToPixels($oElement->getAttribute('y'))); + } + } + + $oElement = $document->getElement('p:spPr/a:xfrm/a:ext', $node); + if ($oElement) { + if ($oElement->hasAttribute('cx')) { + $oShape->setWidth(CommonDrawing::emuToPixels($oElement->getAttribute('cx'))); + } + if ($oElement->hasAttribute('cy')) { + $oShape->setHeight(CommonDrawing::emuToPixels($oElement->getAttribute('cy'))); + } + } + + $oElement = $document->getElement('p:spPr/a:effectLst', $node); + if ($oElement) { + $oShape->getShadow()->setVisible(true); + + $oSubElement = $document->getElement('a:outerShdw', $oElement); + if ($oSubElement) { + if ($oSubElement->hasAttribute('blurRad')) { + $oShape->getShadow()->setBlurRadius(CommonDrawing::emuToPixels($oSubElement->getAttribute('blurRad'))); + } + if ($oSubElement->hasAttribute('dist')) { + $oShape->getShadow()->setDistance(CommonDrawing::emuToPixels($oSubElement->getAttribute('dist'))); + } + if ($oSubElement->hasAttribute('dir')) { + $oShape->getShadow()->setDirection(CommonDrawing::angleToDegrees($oSubElement->getAttribute('dir'))); + } + if ($oSubElement->hasAttribute('algn')) { + $oShape->getShadow()->setAlignment($oSubElement->getAttribute('algn')); + } + } + + $oSubElement = $document->getElement('a:outerShdw/a:srgbClr', $oElement); + if ($oSubElement) { + if ($oSubElement->hasAttribute('val')) { + $oColor = new Color(); + $oColor->setRGB($oSubElement->getAttribute('val')); + $oShape->getShadow()->setColor($oColor); + } + } + + $oSubElement = $document->getElement('a:outerShdw/a:srgbClr/a:alpha', $oElement); + if ($oSubElement) { + if ($oSubElement->hasAttribute('val')) { + $oShape->getShadow()->setAlpha((int) $oSubElement->getAttribute('val') / 1000); + } + } + } + + $this->oPhpPresentation->getActiveSlide()->addShape($oShape); + } + + protected function loadShapeRichText(XMLReader $document, \DOMElement $node, $baseFile) + { + // Core + $oShape = $this->oPhpPresentation->getActiveSlide()->createRichTextShape(); + $oShape->setParagraphs(array()); + // Variables + $fileRels = 'ppt/slides/_rels/'.$baseFile.'.rels'; + + $oElement = $document->getElement('p:spPr/a:xfrm', $node); + if ($oElement && $oElement->hasAttribute('rot')) { + $oShape->setRotation(CommonDrawing::angleToDegrees($oElement->getAttribute('rot'))); + } + + $oElement = $document->getElement('p:spPr/a:xfrm/a:off', $node); + if ($oElement) { + if ($oElement->hasAttribute('x')) { + $oShape->setOffsetX(CommonDrawing::emuToPixels($oElement->getAttribute('x'))); + } + if ($oElement->hasAttribute('y')) { + $oShape->setOffsetY(CommonDrawing::emuToPixels($oElement->getAttribute('y'))); + } + } + + $oElement = $document->getElement('p:spPr/a:xfrm/a:ext', $node); + if ($oElement) { + if ($oElement->hasAttribute('cx')) { + $oShape->setWidth(CommonDrawing::emuToPixels($oElement->getAttribute('cx'))); + } + if ($oElement->hasAttribute('cy')) { + $oShape->setHeight(CommonDrawing::emuToPixels($oElement->getAttribute('cy'))); + } + } + + $arrayElements = $document->getElements('p:txBody/a:p', $node); + foreach ($arrayElements as $oElement) { + // Core + $oParagraph = $oShape->createParagraph(); + $oParagraph->setRichTextElements(array()); + + $oSubElement = $document->getElement('a:pPr', $oElement); + if ($oSubElement) { + if ($oSubElement->hasAttribute('algn')) { + $oParagraph->getAlignment()->setHorizontal($oSubElement->getAttribute('algn')); + } + if ($oSubElement->hasAttribute('fontAlgn')) { + $oParagraph->getAlignment()->setVertical($oSubElement->getAttribute('fontAlgn')); + } + if ($oSubElement->hasAttribute('marL')) { + $oParagraph->getAlignment()->setMarginLeft(CommonDrawing::emuToPixels($oSubElement->getAttribute('marL'))); + } + if ($oSubElement->hasAttribute('marR')) { + $oParagraph->getAlignment()->setMarginRight(CommonDrawing::emuToPixels($oSubElement->getAttribute('marR'))); + } + if ($oSubElement->hasAttribute('indent')) { + $oParagraph->getAlignment()->setIndent(CommonDrawing::emuToPixels($oSubElement->getAttribute('indent'))); + } + if ($oSubElement->hasAttribute('lvl')) { + $oParagraph->getAlignment()->setLevel($oSubElement->getAttribute('lvl')); + } + + $oElement_buFont = $document->getElement('a:buFont', $oSubElement); + $oParagraph->getBulletStyle()->setBulletType(Bullet::TYPE_NONE); + if ($oElement_buFont) { + if ($oElement_buFont->hasAttribute('typeface')) { + $oParagraph->getBulletStyle()->setBulletFont($oElement_buFont->getAttribute('typeface')); + } + } + $oElement_buChar = $document->getElement('a:buChar', $oSubElement); + if ($oElement_buChar) { + $oParagraph->getBulletStyle()->setBulletType(Bullet::TYPE_BULLET); + if ($oElement_buChar->hasAttribute('char')) { + $oParagraph->getBulletStyle()->setBulletChar($oElement_buChar->getAttribute('char')); + } + } + /*$oElement_buAutoNum = $document->getElement('a:buAutoNum', $oSubElement); + if ($oElement_buAutoNum) { + $oParagraph->getBulletStyle()->setBulletType(Bullet::TYPE_NUMERIC); + if ($oElement_buAutoNum->hasAttribute('type')) { + $oParagraph->getBulletStyle()->setBulletNumericStyle($oElement_buAutoNum->getAttribute('type')); + } + if ($oElement_buAutoNum->hasAttribute('startAt') && $oElement_buAutoNum->getAttribute('startAt') != 1) { + $oParagraph->getBulletStyle()->setBulletNumericStartAt($oElement_buAutoNum->getAttribute('startAt')); + } + }*/ + } + $arraySubElements = $document->getElements('(a:r|a:br)', $oElement); + foreach ($arraySubElements as $oSubElement) { + if($oSubElement->tagName == 'a:br') { + $oParagraph->createBreak(); + } + if($oSubElement->tagName == 'a:r') { + $oElement_rPr = $document->getElement('a:rPr', $oSubElement); + if(is_object($oElement_rPr)) { + $oText = $oParagraph->createTextRun(); + + if ($oElement_rPr->hasAttribute('b')) { + $oText->getFont()->setBold($oElement_rPr->getAttribute('b') == 'true' ? true : false); + } + if ($oElement_rPr->hasAttribute('i')) { + $oText->getFont()->setItalic($oElement_rPr->getAttribute('i') == 'true' ? true : false); + } + if ($oElement_rPr->hasAttribute('strike')) { + $oText->getFont()->setStrikethrough($oElement_rPr->getAttribute('strike') == 'noStrike' ? false : true); + } + if ($oElement_rPr->hasAttribute('sz')) { + $oText->getFont()->setSize((int)($oElement_rPr->getAttribute('sz') / 100)); + } + if ($oElement_rPr->hasAttribute('u')) { + $oText->getFont()->setUnderline($oElement_rPr->getAttribute('u')); + } + // Color + $oElement_srgbClr = $document->getElement('a:solidFill/a:srgbClr', $oElement_rPr); + if (is_object($oElement_srgbClr) && $oElement_srgbClr->hasAttribute('val')) { + $oColor = new Color(); + $oColor->setRGB($oElement_srgbClr->getAttribute('val')); + $oText->getFont()->setColor($oColor); + } + // Hyperlink + $oElement_hlinkClick = $document->getElement('a:hlinkClick', $oElement_rPr); + if (is_object($oElement_hlinkClick)) { + if ($oElement_hlinkClick->hasAttribute('tooltip')) { + $oText->getHyperlink()->setTooltip($oElement_hlinkClick->getAttribute('tooltip')); + } + if ($oElement_hlinkClick->hasAttribute('r:id') && isset($this->arrayRels[$fileRels][$oElement_hlinkClick->getAttribute('r:id')])) { + $oText->getHyperlink()->setUrl($this->arrayRels[$fileRels][$oElement_hlinkClick->getAttribute('r:id')]); + } + } + } else { + // $oText = $oParagraph->createText(); + } + + $oSubSubElement = $document->getElement('a:t', $oSubElement); + $oText->setText($oSubSubElement->nodeValue); + } + } + } + + if (count($oShape->getParagraphs()) > 0) { + $oShape->setActiveParagraph(0); + } + } + + /** + * + * @param string $rId + * @return string + */ + protected function loadRels($fileRels) + { + $sPart = $this->oZip->getFromName($fileRels); + if($sPart !== false) { + $xmlReader = new XMLReader(); + if ($xmlReader->getDomFromString($sPart)) { + foreach ($xmlReader->getElements('*') as $oNode) { + $this->arrayRels[$fileRels][$oNode->getAttribute('Id')] = $oNode->getAttribute('Target'); + } + } + } + } +} diff --git a/src/PhpPresentation/Shape/RichText.php b/src/PhpPresentation/Shape/RichText.php index 6a15176e9..b7b827113 100644 --- a/src/PhpPresentation/Shape/RichText.php +++ b/src/PhpPresentation/Shape/RichText.php @@ -232,17 +232,21 @@ public function getParagraph($index = 0) */ public function createParagraph() { - $alignment = clone $this->getActiveParagraph()->getAlignment(); - $font = clone $this->getActiveParagraph()->getFont(); - $bulletStyle = clone $this->getActiveParagraph()->getBulletStyle(); + $numParagraphs = count($this->richTextParagraphs); + if ($numParagraphs > 0) { + $alignment = clone $this->getActiveParagraph()->getAlignment(); + $font = clone $this->getActiveParagraph()->getFont(); + $bulletStyle = clone $this->getActiveParagraph()->getBulletStyle(); + } $this->richTextParagraphs[] = new Paragraph(); $this->activeParagraph = count($this->richTextParagraphs) - 1; - $this->getActiveParagraph()->setAlignment($alignment); - $this->getActiveParagraph()->setFont($font); - $this->getActiveParagraph()->setBulletStyle($bulletStyle); - + if ($numParagraphs > 0) { + $this->getActiveParagraph()->setAlignment($alignment); + $this->getActiveParagraph()->setFont($font); + $this->getActiveParagraph()->setBulletStyle($bulletStyle); + } return $this->getActiveParagraph(); } diff --git a/tests/PhpPresentation/Tests/Reader/PowerPoint2007Test.php b/tests/PhpPresentation/Tests/Reader/PowerPoint2007Test.php new file mode 100644 index 000000000..8015ec9ba --- /dev/null +++ b/tests/PhpPresentation/Tests/Reader/PowerPoint2007Test.php @@ -0,0 +1,465 @@ +assertFalse($object->canRead($file)); + + $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/serialized.phppt'; + $this->assertFalse($object->canRead($file)); + + $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_12.pptx'; + $this->assertTrue($object->canRead($file)); + } + + /** + * @expectedException \Exception + * @expectedExceptionMessage Could not open for reading! File does not exist. + */ + public function testLoadFileNotExists() + { + $object = new PowerPoint2007(); + $object->load(''); + } + + /** + * @expectedException \Exception + * @expectedExceptionMessage Invalid file format for PhpOffice\PhpPresentation\Reader\PowerPoint2007: + */ + public function testLoadFileBadFormat() + { + $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_00_01.ppt'; + $object = new PowerPoint2007(); + $object->load($file); + } + + /** + * @expectedException \Exception + * @expectedExceptionMessage Could not open for reading! File does not exist. + */ + public function testFileSupportsNotExists() + { + $object = new PowerPoint2007(); + $object->fileSupportsUnserializePhpPresentation(''); + } + + public function testLoadFile01() + { + $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_12.pptx'; + $object = new PowerPoint2007(); + $oPhpPresentation = $object->load($file); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $oPhpPresentation); + // Document Properties + $this->assertEquals('PHPOffice', $oPhpPresentation->getProperties()->getCreator()); + $this->assertEquals('PHPPresentation Team', $oPhpPresentation->getProperties()->getLastModifiedBy()); + $this->assertEquals('Sample 02 Title', $oPhpPresentation->getProperties()->getTitle()); + $this->assertEquals('Sample 02 Subject', $oPhpPresentation->getProperties()->getSubject()); + $this->assertEquals('Sample 02 Description', $oPhpPresentation->getProperties()->getDescription()); + $this->assertEquals('office 2007 openxml libreoffice odt php', $oPhpPresentation->getProperties()->getKeywords()); + $this->assertEquals('Sample Category', $oPhpPresentation->getProperties()->getCategory()); + // + $this->assertCount(4, $oPhpPresentation->getAllSlides()); + + // Slide 1 + $oSlide1 = $oPhpPresentation->getSlide(0); + $arrayShape = $oSlide1->getShapeCollection(); + $this->assertCount(2, $arrayShape); + // Slide 1 : Shape 1 + $oShape = $arrayShape[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\MemoryDrawing', $oShape); + $this->assertEquals('PHPPresentation logo', $oShape->getName()); + $this->assertEquals('PHPPresentation logo', $oShape->getDescription()); + $this->assertEquals(36, $oShape->getHeight()); + $this->assertEquals(10, $oShape->getOffsetX()); + $this->assertEquals(10, $oShape->getOffsetY()); + $this->assertTrue($oShape->getShadow()->isVisible()); + $this->assertEquals(45, $oShape->getShadow()->getDirection()); + $this->assertEquals(10, $oShape->getShadow()->getDistance()); + // Slide 1 : Shape 2 + $oShape = $arrayShape[1]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $oShape); + $this->assertEquals(200, $oShape->getHeight()); + $this->assertEquals(600, $oShape->getWidth()); + $this->assertEquals(10, $oShape->getOffsetX()); + $this->assertEquals(400, $oShape->getOffsetY()); + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oShape->getActiveParagraph()->getAlignment()->getHorizontal()); + $arrayParagraphs = $oShape->getParagraphs(); + $this->assertCount(1, $arrayParagraphs); + $oParagraph = $arrayParagraphs[0]; + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(3, $arrayRichText); + // Slide 1 : Shape 2 : Paragraph 1 + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('Introduction to', $oRichText->getText()); + $this->assertTrue($oRichText->getFont()->isBold()); + $this->assertEquals(28, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + // Slide 1 : Shape 2 : Paragraph 2 + $oRichText = $arrayRichText[1]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\BreakElement', $oRichText); + // Slide 1 : Shape 2 : Paragraph 3 + $oRichText = $arrayRichText[2]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('PHPPresentation', $oRichText->getText()); + $this->assertTrue($oRichText->getFont()->isBold()); + $this->assertEquals(60, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + + // Slide 2 + $oSlide2 = $oPhpPresentation->getSlide(1); + $arrayShape = $oSlide2->getShapeCollection(); + $this->assertCount(3, $arrayShape); + // Slide 2 : Shape 1 + $oShape = $arrayShape[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\MemoryDrawing', $oShape); + $this->assertEquals('PHPPresentation logo', $oShape->getName()); + $this->assertEquals('PHPPresentation logo', $oShape->getDescription()); + $this->assertEquals(36, $oShape->getHeight()); + $this->assertEquals(10, $oShape->getOffsetX()); + $this->assertEquals(10, $oShape->getOffsetY()); + $this->assertTrue($oShape->getShadow()->isVisible()); + $this->assertEquals(45, $oShape->getShadow()->getDirection()); + $this->assertEquals(10, $oShape->getShadow()->getDistance()); + // Slide 2 : Shape 2 + $oShape = $arrayShape[1]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $oShape); + $this->assertEquals(100, $oShape->getHeight()); + $this->assertEquals(930, $oShape->getWidth()); + $this->assertEquals(10, $oShape->getOffsetX()); + $this->assertEquals(50, $oShape->getOffsetY()); + $arrayParagraphs = $oShape->getParagraphs(); + $this->assertCount(1, $arrayParagraphs); + $oParagraph = $arrayParagraphs[0]; + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oParagraph->getAlignment()->getHorizontal()); + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + // Slide 2 : Shape 2 : Paragraph 1 + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('What is PHPPresentation?', $oRichText->getText()); + $this->assertTrue($oRichText->getFont()->isBold()); + $this->assertEquals(48, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + // Slide 2 : Shape 3 + $oShape = $arrayShape[2]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $oShape); + $this->assertEquals(600, $oShape->getHeight()); + $this->assertEquals(930, $oShape->getWidth()); + $this->assertEquals(10, $oShape->getOffsetX()); + $this->assertEquals(130, $oShape->getOffsetY()); + $arrayParagraphs = $oShape->getParagraphs(); + $this->assertCount(4, $arrayParagraphs); + // Slide 2 : Shape 3 : Paragraph 1 + $oParagraph = $arrayParagraphs[0]; + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oParagraph->getAlignment()->getHorizontal()); + $this->assertEquals(25, $oParagraph->getAlignment()->getMarginLeft()); + $this->assertEquals(-25, $oParagraph->getAlignment()->getIndent()); + $this->assertEquals(Bullet::TYPE_BULLET, $oParagraph->getBulletStyle()->getBulletType()); + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('A class library', $oRichText->getText()); + $this->assertEquals(36, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + // Slide 2 : Shape 3 : Paragraph 2 + $oParagraph = $arrayParagraphs[1]; + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oParagraph->getAlignment()->getHorizontal()); + $this->assertEquals(25, $oParagraph->getAlignment()->getMarginLeft()); + $this->assertEquals(-25, $oParagraph->getAlignment()->getIndent()); + $this->assertEquals(Bullet::TYPE_BULLET, $oParagraph->getBulletStyle()->getBulletType()); + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('Written in PHP', $oRichText->getText()); + $this->assertEquals(36, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + // Slide 2 : Shape 3 : Paragraph 3 + $oParagraph = $arrayParagraphs[2]; + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oParagraph->getAlignment()->getHorizontal()); + $this->assertEquals(25, $oParagraph->getAlignment()->getMarginLeft()); + $this->assertEquals(-25, $oParagraph->getAlignment()->getIndent()); + $this->assertEquals(Bullet::TYPE_BULLET, $oParagraph->getBulletStyle()->getBulletType()); + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('Representing a presentation', $oRichText->getText()); + $this->assertEquals(36, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + // Slide 2 : Shape 3 : Paragraph 4 + $oParagraph = $arrayParagraphs[3]; + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oParagraph->getAlignment()->getHorizontal()); + $this->assertEquals(25, $oParagraph->getAlignment()->getMarginLeft()); + $this->assertEquals(-25, $oParagraph->getAlignment()->getIndent()); + $this->assertEquals(Bullet::TYPE_BULLET, $oParagraph->getBulletStyle()->getBulletType()); + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('Supports writing to different file formats', $oRichText->getText()); + $this->assertEquals(36, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + + // Slide 3 + $oSlide2 = $oPhpPresentation->getSlide(2); + $arrayShape = $oSlide2->getShapeCollection(); + $this->assertCount(3, $arrayShape); + // Slide 3 : Shape 1 + $oShape = $arrayShape[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\MemoryDrawing', $oShape); + $this->assertEquals('PHPPresentation logo', $oShape->getName()); + $this->assertEquals('PHPPresentation logo', $oShape->getDescription()); + $this->assertEquals(36, $oShape->getHeight()); + $this->assertEquals(10, $oShape->getOffsetX()); + $this->assertEquals(10, $oShape->getOffsetY()); + $this->assertTrue($oShape->getShadow()->isVisible()); + $this->assertEquals(45, $oShape->getShadow()->getDirection()); + $this->assertEquals(10, $oShape->getShadow()->getDistance()); + // Slide 3 : Shape 2 + $oShape = $arrayShape[1]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $oShape); + $this->assertEquals(100, $oShape->getHeight()); + $this->assertEquals(930, $oShape->getWidth()); + $this->assertEquals(10, $oShape->getOffsetX()); + $this->assertEquals(50, $oShape->getOffsetY()); + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oShape->getActiveParagraph()->getAlignment()->getHorizontal()); + $arrayParagraphs = $oShape->getParagraphs(); + $this->assertCount(1, $arrayParagraphs); + $oParagraph = $arrayParagraphs[0]; + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + // Slide 3 : Shape 2 : Paragraph 1 + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('What\'s the point?', $oRichText->getText()); + $this->assertTrue($oRichText->getFont()->isBold()); + $this->assertEquals(48, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + // Slide 3 : Shape 2 + $oShape = $arrayShape[2]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $oShape); + $this->assertEquals(600, $oShape->getHeight()); + $this->assertEquals(930, $oShape->getWidth()); + $this->assertEquals(10, $oShape->getOffsetX()); + $this->assertEquals(130, $oShape->getOffsetY()); + $arrayParagraphs = $oShape->getParagraphs(); + $this->assertCount(8, $arrayParagraphs); + // Slide 3 : Shape 3 : Paragraph 1 + $oParagraph = $arrayParagraphs[0]; + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oParagraph->getAlignment()->getHorizontal()); + $this->assertEquals(25, $oParagraph->getAlignment()->getMarginLeft()); + $this->assertEquals(-25, $oParagraph->getAlignment()->getIndent()); + $this->assertEquals(0, $oParagraph->getAlignment()->getLevel()); + $this->assertEquals(Bullet::TYPE_BULLET, $oParagraph->getBulletStyle()->getBulletType()); + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('Generate slide decks', $oRichText->getText()); + $this->assertEquals(36, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + // Slide 3 : Shape 3 : Paragraph 2 + $oParagraph = $arrayParagraphs[1]; + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oParagraph->getAlignment()->getHorizontal()); + $this->assertEquals(75, $oParagraph->getAlignment()->getMarginLeft()); + $this->assertEquals(-25, $oParagraph->getAlignment()->getIndent()); + $this->assertEquals(1, $oParagraph->getAlignment()->getLevel()); + $this->assertEquals(Bullet::TYPE_BULLET, $oParagraph->getBulletStyle()->getBulletType()); + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('Represent business data', $oRichText->getText()); + $this->assertEquals(36, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + // Slide 3 : Shape 3 : Paragraph 3 + $oParagraph = $arrayParagraphs[2]; + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oParagraph->getAlignment()->getHorizontal()); + $this->assertEquals(75, $oParagraph->getAlignment()->getMarginLeft()); + $this->assertEquals(-25, $oParagraph->getAlignment()->getIndent()); + $this->assertEquals(1, $oParagraph->getAlignment()->getLevel()); + $this->assertEquals(Bullet::TYPE_BULLET, $oParagraph->getBulletStyle()->getBulletType()); + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('Show a family slide show', $oRichText->getText()); + $this->assertEquals(36, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + // Slide 3 : Shape 3 : Paragraph 4 + $oParagraph = $arrayParagraphs[3]; + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oParagraph->getAlignment()->getHorizontal()); + $this->assertEquals(75, $oParagraph->getAlignment()->getMarginLeft()); + $this->assertEquals(-25, $oParagraph->getAlignment()->getIndent()); + $this->assertEquals(1, $oParagraph->getAlignment()->getLevel()); + $this->assertEquals(Bullet::TYPE_BULLET, $oParagraph->getBulletStyle()->getBulletType()); + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('...', $oRichText->getText()); + $this->assertEquals(36, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + // Slide 3 : Shape 3 : Paragraph 5 + $oParagraph = $arrayParagraphs[4]; + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oParagraph->getAlignment()->getHorizontal()); + $this->assertEquals(25, $oParagraph->getAlignment()->getMarginLeft()); + $this->assertEquals(-25, $oParagraph->getAlignment()->getIndent()); + $this->assertEquals(0, $oParagraph->getAlignment()->getLevel()); + $this->assertEquals(Bullet::TYPE_BULLET, $oParagraph->getBulletStyle()->getBulletType()); + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('Export these to different formats', $oRichText->getText()); + $this->assertEquals(36, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + // Slide 3 : Shape 3 : Paragraph 6 + $oParagraph = $arrayParagraphs[5]; + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oParagraph->getAlignment()->getHorizontal()); + $this->assertEquals(75, $oParagraph->getAlignment()->getMarginLeft()); + $this->assertEquals(-25, $oParagraph->getAlignment()->getIndent()); + $this->assertEquals(1, $oParagraph->getAlignment()->getLevel()); + $this->assertEquals(Bullet::TYPE_BULLET, $oParagraph->getBulletStyle()->getBulletType()); + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('PHPPresentation 2007', $oRichText->getText()); + $this->assertEquals(36, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + // Slide 3 : Shape 3 : Paragraph 7 + $oParagraph = $arrayParagraphs[6]; + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oParagraph->getAlignment()->getHorizontal()); + $this->assertEquals(75, $oParagraph->getAlignment()->getMarginLeft()); + $this->assertEquals(-25, $oParagraph->getAlignment()->getIndent()); + $this->assertEquals(1, $oParagraph->getAlignment()->getLevel()); + $this->assertEquals(Bullet::TYPE_BULLET, $oParagraph->getBulletStyle()->getBulletType()); + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('Serialized', $oRichText->getText()); + $this->assertEquals(36, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + // Slide 3 : Shape 3 : Paragraph 8 + $oParagraph = $arrayParagraphs[7]; + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oParagraph->getAlignment()->getHorizontal()); + $this->assertEquals(75, $oParagraph->getAlignment()->getMarginLeft()); + $this->assertEquals(-25, $oParagraph->getAlignment()->getIndent()); + $this->assertEquals(1, $oParagraph->getAlignment()->getLevel()); + $this->assertEquals(Bullet::TYPE_BULLET, $oParagraph->getBulletStyle()->getBulletType()); + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('... (more to come) ...', $oRichText->getText()); + $this->assertEquals(36, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + + // Slide 4 + $oSlide3 = $oPhpPresentation->getSlide(3); + $arrayShape = $oSlide3->getShapeCollection(); + $this->assertCount(3, $arrayShape); + // Slide 4 : Shape 1 + $oShape = $arrayShape[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\MemoryDrawing', $oShape); + $this->assertEquals('PHPPresentation logo', $oShape->getName()); + $this->assertEquals('PHPPresentation logo', $oShape->getDescription()); + $this->assertEquals(36, $oShape->getHeight()); + $this->assertEquals(10, $oShape->getOffsetX()); + $this->assertEquals(10, $oShape->getOffsetY()); + $this->assertTrue($oShape->getShadow()->isVisible()); + $this->assertEquals(45, $oShape->getShadow()->getDirection()); + $this->assertEquals(10, $oShape->getShadow()->getDistance()); + // Slide 4 : Shape 2 + $oShape = $arrayShape[1]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $oShape); + $this->assertEquals(100, $oShape->getHeight()); + $this->assertEquals(930, $oShape->getWidth()); + $this->assertEquals(10, $oShape->getOffsetX()); + $this->assertEquals(50, $oShape->getOffsetY()); + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oShape->getActiveParagraph()->getAlignment()->getHorizontal()); + $arrayParagraphs = $oShape->getParagraphs(); + $this->assertCount(1, $arrayParagraphs); + $oParagraph = $arrayParagraphs[0]; + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + // Slide 4 : Shape 2 : Paragraph 1 + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('Need more info?', $oRichText->getText()); + $this->assertTrue($oRichText->getFont()->isBold()); + $this->assertEquals(48, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oShape->getActiveParagraph()->getFont()->getColor()->getARGB()); + // Slide 4 : Shape 3 + $oShape = $arrayShape[2]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $oShape); + $this->assertEquals(600, $oShape->getHeight()); + $this->assertEquals(930, $oShape->getWidth()); + $this->assertEquals(10, $oShape->getOffsetX()); + $this->assertEquals(130, $oShape->getOffsetY()); + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oShape->getActiveParagraph()->getAlignment()->getHorizontal()); + $arrayParagraphs = $oShape->getParagraphs(); + $this->assertCount(1, $arrayParagraphs); + $oParagraph = $arrayParagraphs[0]; + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(3, $arrayRichText); + // Slide 4 : Shape 3 : Paragraph 1 + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('Check the project site on GitHub:', $oRichText->getText()); + $this->assertFalse($oRichText->getFont()->isBold()); + $this->assertEquals(36, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oShape->getActiveParagraph()->getFont()->getColor()->getARGB()); + // Slide 4 : Shape 3 : Paragraph 2 + $oRichText = $arrayRichText[1]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\BreakElement', $oRichText); + // Slide 4 : Shape 3 : Paragraph 3 + $oRichText = $arrayRichText[2]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('https://github.com/PHPOffice/PHPPresentation/', $oRichText->getText()); + $this->assertFalse($oRichText->getFont()->isBold()); + $this->assertEquals(32, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oShape->getActiveParagraph()->getFont()->getColor()->getARGB()); + $this->assertTrue($oRichText->hasHyperlink()); + $this->assertEquals('https://github.com/PHPOffice/PHPPresentation/', $oRichText->getHyperlink()->getUrl()); + $this->assertEquals('PHPPresentation', $oRichText->getHyperlink()->getTooltip()); + } +} diff --git a/tests/resources/files/Sample_12.pptx b/tests/resources/files/Sample_12.pptx new file mode 100644 index 0000000000000000000000000000000000000000..18fe0d0e71f565bcb3851f0f6797042d37645da8 GIT binary patch literal 60849 zcmdqJQ*>tAw!aBg_;l~dszqMaK&kNj8lIzV9ly3pjy#a`#jEYdi?aYQgUSal`<$$}9 zL;={4#3nl*%|MX0p6unzjo{!4XE3pffRlYEr3svpYI)(8-W`&2(c2J4&4!neVzp)5 zcS8z6rNk;23>7cWT_zcF1Ze14(3mR|2N!zhrj>t(zg3s`#()JVW@DZ6zjndnTFpuh z^5&s1?I)Cj(p1P{lN*i1D4UCorPip7Xt`<}I%s!{9e0})6j)iaRrB zNb((L2yL-&BAf35xwMtFgCsmmJ6X;}rRxEA(W}p{l+vem(Q-Qwyjc+O%h&3Wu)Eqo zfoOgBMdILK-2!FX*%bd=v&wx!%>~|tjWED291jUv)Zs;3{i@T@F>@{t=7$%$-)FW1 z*W03-?iTpaJQOwSjuw>uwxgQ~f7>7=N+ogCIyQSwD@&QW;|h%&FQ<0c{;dc$j42Yb z%Iv{OSj&N!f^%ELq}_Dn!E*_6lYYvZM%@08LfEo#t}~}uLnbJ0#?&SX&Ct}pxG!s2 z4hUwtBvfRGYmJl?RmL2&-c!AYxQL_Tq{z=nn+Dxn;@W=;OLL=scT03_Fw_U7@J_}l zeUM7`a4n`W+Y9)wt`~L|urK&>dDGYDj}`cb>mBtCtc(>M-K>oNbUy63BwQ~(3g1j? zIlgVQT!9AGjM+jQlM|p?_G(}Z;11bf=h)Q&scEe{mt;1^972b`#kgPYWdP=zbkB1` zF>GvNBikxi3=~hQUL!V*V+P$rDlZy5MS}m+yaniECLWDpX?OmdIX3RmSbOl1BQ2)w zxX?RgOTCmGkFg9qZfH-rzwJ7tyku)p{ko0Bz7SN~c3qxy=Zf>~d(#Q&DPGO~5&U0` zYH!_Kt^6{E{41yaGoPHzja~jLpQ56<;Cks1gkCcVSF_pW@KN*?d`l>{095J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u(=& zH?kdZiY8YeL$5*IpPvm`Y5k=3-OzWPUn4Y=x^MS;L+@VwB=Lixe{M_<-eO@%{Lx0? z{A#FD_b0XQhJM?C#@Vm2ql0!=1Zbxd{}g08!=EI6F!axj<||0G_e-D%9fC6F&k=fK z^po0mL%(e(JHVGZ&Ox24BhZuNCqq$Ye@a*y8kp+Q+nCtcSUVfq*;t!`PKzw8jjb8~ zxRdnPfd8{xd(eND`@ZF7vkKBspdLN|Ko9y6K?VTS JmjC$ce*l~76%zme literal 0 HcmV?d00001 From aee6381b410279d16aae08795f13807c62db9a95 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Tue, 21 Jul 2015 13:51:25 +0200 Subject: [PATCH 09/15] PowerPoint2007 Reader : Initial Commit - GH-44 (Fixes PHPCS / PHPMd) --- src/PhpPresentation/Reader/PowerPoint2007.php | 88 +++++++++---------- src/PhpPresentation/Shape/RichText.php | 6 +- .../Tests/Reader/PowerPoint2007Test.php | 2 +- 3 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/PhpPresentation/Reader/PowerPoint2007.php b/src/PhpPresentation/Reader/PowerPoint2007.php index 2e7c14b2f..793ffbf38 100644 --- a/src/PhpPresentation/Reader/PowerPoint2007.php +++ b/src/PhpPresentation/Reader/PowerPoint2007.php @@ -157,7 +157,7 @@ protected function loadDocumentProperties($sPart) $oProperties = $this->oPhpPresentation->getProperties(); foreach ($arrayProperties as $path => $property) { if (is_object($oElement = $xmlReader->getElement($path))) { - if($oElement->hasAttribute('xsi:type') && $oElement->getAttribute('xsi:type') == 'dcterms:W3CDTF') { + if ($oElement->hasAttribute('xsi:type') && $oElement->getAttribute('xsi:type') == 'dcterms:W3CDTF') { $oDateTime = new \DateTime(); $oDateTime->createFromFormat(\DateTime::W3C, $oElement->nodeValue); $oProperties->{$property}($oDateTime->getTimestamp()); @@ -222,7 +222,7 @@ protected function loadSlide($sPart, $baseFile) } /** - * + * * @param XMLReader $document * @param \DOMElement $node * @param string $baseFile @@ -236,7 +236,7 @@ protected function loadShapeDrawing(XMLReader $document, \DOMElement $node, $bas $fileRels = 'ppt/slides/_rels/'.$baseFile.'.rels'; $oElement = $document->getElement('p:nvPicPr/p:cNvPr', $node); - if($oElement) { + if ($oElement) { $oShape->setName($oElement->hasAttribute('name') ? $oElement->getAttribute('name') : ''); $oShape->setDescription($oElement->hasAttribute('descr') ? $oElement->getAttribute('descr') : ''); } @@ -247,7 +247,7 @@ protected function loadShapeDrawing(XMLReader $document, \DOMElement $node, $bas $pathImage = 'ppt/slides/'.$this->arrayRels[$fileRels][$oElement->getAttribute('r:embed')]; $pathImage = explode('/', $pathImage); foreach ($pathImage as $key => $partPath) { - if($partPath == '..') { + if ($partPath == '..') { unset($pathImage[$key - 1]); unset($pathImage[$key]); } @@ -387,71 +387,71 @@ protected function loadShapeRichText(XMLReader $document, \DOMElement $node, $ba $oParagraph->getAlignment()->setLevel($oSubElement->getAttribute('lvl')); } - $oElement_buFont = $document->getElement('a:buFont', $oSubElement); + $oElementBuFont = $document->getElement('a:buFont', $oSubElement); $oParagraph->getBulletStyle()->setBulletType(Bullet::TYPE_NONE); - if ($oElement_buFont) { - if ($oElement_buFont->hasAttribute('typeface')) { - $oParagraph->getBulletStyle()->setBulletFont($oElement_buFont->getAttribute('typeface')); + if ($oElementBuFont) { + if ($oElementBuFont->hasAttribute('typeface')) { + $oParagraph->getBulletStyle()->setBulletFont($oElementBuFont->getAttribute('typeface')); } } - $oElement_buChar = $document->getElement('a:buChar', $oSubElement); - if ($oElement_buChar) { + $oElementBuChar = $document->getElement('a:buChar', $oSubElement); + if ($oElementBuChar) { $oParagraph->getBulletStyle()->setBulletType(Bullet::TYPE_BULLET); - if ($oElement_buChar->hasAttribute('char')) { - $oParagraph->getBulletStyle()->setBulletChar($oElement_buChar->getAttribute('char')); + if ($oElementBuChar->hasAttribute('char')) { + $oParagraph->getBulletStyle()->setBulletChar($oElementBuChar->getAttribute('char')); } } - /*$oElement_buAutoNum = $document->getElement('a:buAutoNum', $oSubElement); - if ($oElement_buAutoNum) { + /*$oElementBuAutoNum = $document->getElement('a:buAutoNum', $oSubElement); + if ($oElementBuAutoNum) { $oParagraph->getBulletStyle()->setBulletType(Bullet::TYPE_NUMERIC); - if ($oElement_buAutoNum->hasAttribute('type')) { - $oParagraph->getBulletStyle()->setBulletNumericStyle($oElement_buAutoNum->getAttribute('type')); + if ($oElementBuAutoNum->hasAttribute('type')) { + $oParagraph->getBulletStyle()->setBulletNumericStyle($oElementBuAutoNum->getAttribute('type')); } - if ($oElement_buAutoNum->hasAttribute('startAt') && $oElement_buAutoNum->getAttribute('startAt') != 1) { - $oParagraph->getBulletStyle()->setBulletNumericStartAt($oElement_buAutoNum->getAttribute('startAt')); + if ($oElementBuAutoNum->hasAttribute('startAt') && $oElementBuAutoNum->getAttribute('startAt') != 1) { + $oParagraph->getBulletStyle()->setBulletNumericStartAt($oElementBuAutoNum->getAttribute('startAt')); } }*/ } $arraySubElements = $document->getElements('(a:r|a:br)', $oElement); foreach ($arraySubElements as $oSubElement) { - if($oSubElement->tagName == 'a:br') { + if ($oSubElement->tagName == 'a:br') { $oParagraph->createBreak(); } - if($oSubElement->tagName == 'a:r') { - $oElement_rPr = $document->getElement('a:rPr', $oSubElement); - if(is_object($oElement_rPr)) { + if ($oSubElement->tagName == 'a:r') { + $oElementrPr = $document->getElement('a:rPr', $oSubElement); + if (is_object($oElementrPr)) { $oText = $oParagraph->createTextRun(); - if ($oElement_rPr->hasAttribute('b')) { - $oText->getFont()->setBold($oElement_rPr->getAttribute('b') == 'true' ? true : false); + if ($oElementrPr->hasAttribute('b')) { + $oText->getFont()->setBold($oElementrPr->getAttribute('b') == 'true' ? true : false); } - if ($oElement_rPr->hasAttribute('i')) { - $oText->getFont()->setItalic($oElement_rPr->getAttribute('i') == 'true' ? true : false); + if ($oElementrPr->hasAttribute('i')) { + $oText->getFont()->setItalic($oElementrPr->getAttribute('i') == 'true' ? true : false); } - if ($oElement_rPr->hasAttribute('strike')) { - $oText->getFont()->setStrikethrough($oElement_rPr->getAttribute('strike') == 'noStrike' ? false : true); + if ($oElementrPr->hasAttribute('strike')) { + $oText->getFont()->setStrikethrough($oElementrPr->getAttribute('strike') == 'noStrike' ? false : true); } - if ($oElement_rPr->hasAttribute('sz')) { - $oText->getFont()->setSize((int)($oElement_rPr->getAttribute('sz') / 100)); + if ($oElementrPr->hasAttribute('sz')) { + $oText->getFont()->setSize((int)($oElementrPr->getAttribute('sz') / 100)); } - if ($oElement_rPr->hasAttribute('u')) { - $oText->getFont()->setUnderline($oElement_rPr->getAttribute('u')); + if ($oElementrPr->hasAttribute('u')) { + $oText->getFont()->setUnderline($oElementrPr->getAttribute('u')); } // Color - $oElement_srgbClr = $document->getElement('a:solidFill/a:srgbClr', $oElement_rPr); - if (is_object($oElement_srgbClr) && $oElement_srgbClr->hasAttribute('val')) { + $oElementSrgbClr = $document->getElement('a:solidFill/a:srgbClr', $oElementrPr); + if (is_object($oElementSrgbClr) && $oElementSrgbClr->hasAttribute('val')) { $oColor = new Color(); - $oColor->setRGB($oElement_srgbClr->getAttribute('val')); + $oColor->setRGB($oElementSrgbClr->getAttribute('val')); $oText->getFont()->setColor($oColor); } // Hyperlink - $oElement_hlinkClick = $document->getElement('a:hlinkClick', $oElement_rPr); - if (is_object($oElement_hlinkClick)) { - if ($oElement_hlinkClick->hasAttribute('tooltip')) { - $oText->getHyperlink()->setTooltip($oElement_hlinkClick->getAttribute('tooltip')); + $oElementHlinkClick = $document->getElement('a:hlinkClick', $oElementrPr); + if (is_object($oElementHlinkClick)) { + if ($oElementHlinkClick->hasAttribute('tooltip')) { + $oText->getHyperlink()->setTooltip($oElementHlinkClick->getAttribute('tooltip')); } - if ($oElement_hlinkClick->hasAttribute('r:id') && isset($this->arrayRels[$fileRels][$oElement_hlinkClick->getAttribute('r:id')])) { - $oText->getHyperlink()->setUrl($this->arrayRels[$fileRels][$oElement_hlinkClick->getAttribute('r:id')]); + if ($oElementHlinkClick->hasAttribute('r:id') && isset($this->arrayRels[$fileRels][$oElementHlinkClick->getAttribute('r:id')])) { + $oText->getHyperlink()->setUrl($this->arrayRels[$fileRels][$oElementHlinkClick->getAttribute('r:id')]); } } } else { @@ -461,7 +461,7 @@ protected function loadShapeRichText(XMLReader $document, \DOMElement $node, $ba $oSubSubElement = $document->getElement('a:t', $oSubElement); $oText->setText($oSubSubElement->nodeValue); } - } + } } if (count($oShape->getParagraphs()) > 0) { @@ -470,14 +470,14 @@ protected function loadShapeRichText(XMLReader $document, \DOMElement $node, $ba } /** - * + * * @param string $rId * @return string */ protected function loadRels($fileRels) { $sPart = $this->oZip->getFromName($fileRels); - if($sPart !== false) { + if ($sPart !== false) { $xmlReader = new XMLReader(); if ($xmlReader->getDomFromString($sPart)) { foreach ($xmlReader->getElements('*') as $oNode) { diff --git a/src/PhpPresentation/Shape/RichText.php b/src/PhpPresentation/Shape/RichText.php index b7b827113..67e461268 100644 --- a/src/PhpPresentation/Shape/RichText.php +++ b/src/PhpPresentation/Shape/RichText.php @@ -232,12 +232,12 @@ public function getParagraph($index = 0) */ public function createParagraph() { - $numParagraphs = count($this->richTextParagraphs); - if ($numParagraphs > 0) { + $numParagraphs = count($this->richTextParagraphs); + if ($numParagraphs > 0) { $alignment = clone $this->getActiveParagraph()->getAlignment(); $font = clone $this->getActiveParagraph()->getFont(); $bulletStyle = clone $this->getActiveParagraph()->getBulletStyle(); - } + } $this->richTextParagraphs[] = new Paragraph(); $this->activeParagraph = count($this->richTextParagraphs) - 1; diff --git a/tests/PhpPresentation/Tests/Reader/PowerPoint2007Test.php b/tests/PhpPresentation/Tests/Reader/PowerPoint2007Test.php index 8015ec9ba..9f0ceb651 100644 --- a/tests/PhpPresentation/Tests/Reader/PowerPoint2007Test.php +++ b/tests/PhpPresentation/Tests/Reader/PowerPoint2007Test.php @@ -90,7 +90,7 @@ public function testLoadFile01() $this->assertEquals('Sample 02 Description', $oPhpPresentation->getProperties()->getDescription()); $this->assertEquals('office 2007 openxml libreoffice odt php', $oPhpPresentation->getProperties()->getKeywords()); $this->assertEquals('Sample Category', $oPhpPresentation->getProperties()->getCategory()); - // + // $this->assertCount(4, $oPhpPresentation->getAllSlides()); // Slide 1 From ec313eff0ad464b0d4f2cbd01ebefb4f05ee7792 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Tue, 21 Jul 2015 14:27:52 +0200 Subject: [PATCH 10/15] PowerPoint2007 Reader : Initial Commit - GH-44 (Fixes Scrutinizer CI) --- src/PhpPresentation/Reader/PowerPoint2007.php | 58 +++++++++---------- src/PhpPresentation/Shape/RichText.php | 6 +- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/PhpPresentation/Reader/PowerPoint2007.php b/src/PhpPresentation/Reader/PowerPoint2007.php index 793ffbf38..e6f77f5dc 100644 --- a/src/PhpPresentation/Reader/PowerPoint2007.php +++ b/src/PhpPresentation/Reader/PowerPoint2007.php @@ -18,18 +18,11 @@ namespace PhpOffice\PhpPresentation\Reader; use ZipArchive; -use PhpOffice\Common\Text; use PhpOffice\Common\XMLReader; use PhpOffice\Common\Drawing as CommonDrawing; -use PhpOffice\PhpPresentation\AbstractShape; use PhpOffice\PhpPresentation\PhpPresentation; -use PhpOffice\PhpPresentation\Shape\Drawing; -use PhpOffice\PhpPresentation\Shape\Group; use PhpOffice\PhpPresentation\Shape\Hyperlink; -use PhpOffice\PhpPresentation\Shape\Line; use PhpOffice\PhpPresentation\Shape\MemoryDrawing; -use PhpOffice\PhpPresentation\Shape\RichText; -use PhpOffice\PhpPresentation\Style\Alignment; use PhpOffice\PhpPresentation\Style\Bullet; use PhpOffice\PhpPresentation\Style\Color; @@ -142,28 +135,29 @@ protected function loadFile($pFilename) protected function loadDocumentProperties($sPart) { $xmlReader = new XMLReader(); - if ($xmlReader->getDomFromString($sPart)) { - $arrayProperties = array( - '/cp:coreProperties/dc:creator' => 'setCreator', - '/cp:coreProperties/cp:lastModifiedBy' => 'setLastModifiedBy', - '/cp:coreProperties/dc:title' => 'setTitle', - '/cp:coreProperties/dc:description' => 'setDescription', - '/cp:coreProperties/dc:subject' => 'setSubject', - '/cp:coreProperties/cp:keywords' => 'setKeywords', - '/cp:coreProperties/cp:category' => 'setCategory', - '/cp:coreProperties/dcterms:created' => 'setCreated', - '/cp:coreProperties/dcterms:modified' => 'setModified', - ); - $oProperties = $this->oPhpPresentation->getProperties(); - foreach ($arrayProperties as $path => $property) { - if (is_object($oElement = $xmlReader->getElement($path))) { - if ($oElement->hasAttribute('xsi:type') && $oElement->getAttribute('xsi:type') == 'dcterms:W3CDTF') { - $oDateTime = new \DateTime(); - $oDateTime->createFromFormat(\DateTime::W3C, $oElement->nodeValue); - $oProperties->{$property}($oDateTime->getTimestamp()); - } else { - $oProperties->{$property}($oElement->nodeValue); - } + if (!$xmlReader->getDomFromString($sPart)) { + return false; + } + $arrayProperties = array( + '/cp:coreProperties/dc:creator' => 'setCreator', + '/cp:coreProperties/cp:lastModifiedBy' => 'setLastModifiedBy', + '/cp:coreProperties/dc:title' => 'setTitle', + '/cp:coreProperties/dc:description' => 'setDescription', + '/cp:coreProperties/dc:subject' => 'setSubject', + '/cp:coreProperties/cp:keywords' => 'setKeywords', + '/cp:coreProperties/cp:category' => 'setCategory', + '/cp:coreProperties/dcterms:created' => 'setCreated', + '/cp:coreProperties/dcterms:modified' => 'setModified', + ); + $oProperties = $this->oPhpPresentation->getProperties(); + foreach ($arrayProperties as $path => $property) { + if (is_object($oElement = $xmlReader->getElement($path))) { + if ($oElement->hasAttribute('xsi:type') && $oElement->getAttribute('xsi:type') == 'dcterms:W3CDTF') { + $oDateTime = new \DateTime(); + $oDateTime->createFromFormat(\DateTime::W3C, $oElement->nodeValue); + $oProperties->{$property}($oDateTime->getTimestamp()); + } else { + $oProperties->{$property}($oElement->nodeValue); } } } @@ -196,6 +190,8 @@ protected function loadSlides($sPart) /** * Extract data from slide + * @param string $sPart + * @param string $baseFile */ protected function loadSlide($sPart, $baseFile) { @@ -454,7 +450,7 @@ protected function loadShapeRichText(XMLReader $document, \DOMElement $node, $ba $oText->getHyperlink()->setUrl($this->arrayRels[$fileRels][$oElementHlinkClick->getAttribute('r:id')]); } } - } else { + //} else { // $oText = $oParagraph->createText(); } @@ -471,7 +467,7 @@ protected function loadShapeRichText(XMLReader $document, \DOMElement $node, $ba /** * - * @param string $rId + * @param string $fileRels * @return string */ protected function loadRels($fileRels) diff --git a/src/PhpPresentation/Shape/RichText.php b/src/PhpPresentation/Shape/RichText.php index 67e461268..43ec1a681 100644 --- a/src/PhpPresentation/Shape/RichText.php +++ b/src/PhpPresentation/Shape/RichText.php @@ -242,9 +242,13 @@ public function createParagraph() $this->richTextParagraphs[] = new Paragraph(); $this->activeParagraph = count($this->richTextParagraphs) - 1; - if ($numParagraphs > 0) { + if (isset($alignment)) { $this->getActiveParagraph()->setAlignment($alignment); + } + if (isset($font)) { $this->getActiveParagraph()->setFont($font); + } + if (isset($bulletStyle)) { $this->getActiveParagraph()->setBulletStyle($bulletStyle); } return $this->getActiveParagraph(); From 563d7ecf2d54ba5efee5df79379f8f6973eb0d85 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Wed, 22 Jul 2015 12:36:40 +0200 Subject: [PATCH 11/15] Travis : Migrating from legacy - GH-115 --- .travis.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 62310d2c1..f4b53a796 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ +sudo: false language: php php: @@ -17,10 +18,12 @@ env: global: - secure: "LtlUOzC8FtqgbqUTmU7EU281NSCb58UFdvnz8lelNIDltBdP4eayN/TsgNIePB4jXg2d2R56ZA6j/grhE/md6jdUkulV355H3GrH/hIZmmQ+F9+87agnwLzb9+MJbqXoiE7VvjY3zGIO09G897SUfsfu6JWEcscYFlsH6KcXM6M=" +addons: + apt: + packages: + - graphviz + before_script: - ## Packages - - sudo apt-get -qq update > /dev/null - - sudo apt-get -qq install graphviz > /dev/null ## Composer - composer self-update - composer install --prefer-source --dev @@ -55,4 +58,4 @@ notifications: - https://webhooks.gitter.im/e/0dbc70ac93ba40880eef on_success: change # options: [always|never|change] default: always on_failure: always # options: [always|never|change] default: always - on_start: false # default: false \ No newline at end of file + on_start: false # default: false From cf6ed03dc007b14e806e022d4d947672417bc1cc Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Wed, 22 Jul 2015 12:44:09 +0200 Subject: [PATCH 12/15] Travis : Migrating from legacy - GH-115 --- .travis.yml | 2 +- CHANGELOG.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f4b53a796..dc2e11574 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ addons: before_script: ## Composer - composer self-update - - composer install --prefer-source --dev + - composer install --prefer-source ## PHPDocumentor - mkdir -p build/docs - mkdir -p build/coverage diff --git a/CHANGELOG.md b/CHANGELOG.md index 2123931ea..2ff49a07f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ - PhpOffice\PhpPowerpoint\DocumentLayout::setLayoutXmilli has been removed : setCX(DocumentLayout::UNIT_MILLIMETER) - @Progi1984 - PhpOffice\PhpPowerpoint\DocumentLayout::setLayoutYmilli has been removed : setCY(DocumentLayout::UNIT_MILLIMETER) - @Progi1984 - Update the dependence PhpOffice\Common to 0.2.* - @Progi1984 +- Migrated Travis CI to legacy - @Progi1984 GH-115 ## 0.4.0 - 2015-07-07 From 403cffa7effccadef1cdf6e4dafb4dab9dc09d6a Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Wed, 29 Jul 2015 13:59:29 +0200 Subject: [PATCH 13/15] ODPresentation Reader : Initial Commit - GH-113 --- CHANGELOG.md | 1 + samples/Sample_12_Reader_ODPresentation.php | 25 + samples/resources/Sample_12.odp | Bin 0 -> 12071 bytes src/PhpPresentation/IOFactory.php | 2 +- src/PhpPresentation/Reader/ODPresentation.php | 463 +++++++++++++++++ src/PhpPresentation/Reader/PowerPoint2007.php | 50 +- .../Writer/ODPresentation/Content.php | 5 + .../Tests/Reader/ODPresentationTest.php | 467 ++++++++++++++++++ tests/resources/files/Sample_12.odp | Bin 0 -> 12071 bytes 9 files changed, 984 insertions(+), 29 deletions(-) create mode 100644 samples/Sample_12_Reader_ODPresentation.php create mode 100644 samples/resources/Sample_12.odp create mode 100644 src/PhpPresentation/Reader/ODPresentation.php create mode 100644 tests/PhpPresentation/Tests/Reader/ODPresentationTest.php create mode 100644 tests/resources/files/Sample_12.odp diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ff49a07f..6c94ea8df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### Features - PowerPoint2007 Reader : Initial Commit - @Progi1984 GH-44 +- ODPresentation Reader : Initial Commit - @Progi1984 GH-113 ### Bugfix - Fixed the sample in Readme.md - @Progi1984 GH-114 diff --git a/samples/Sample_12_Reader_ODPresentation.php b/samples/Sample_12_Reader_ODPresentation.php new file mode 100644 index 000000000..e66502187 --- /dev/null +++ b/samples/Sample_12_Reader_ODPresentation.php @@ -0,0 +1,25 @@ +load('resources/Sample_12.odp'); + +$oTree = new PhpPptTree($oPHPPresentation); +echo $oTree->display(); +if (!CLI) { + include_once 'Sample_Footer.php'; +} diff --git a/samples/resources/Sample_12.odp b/samples/resources/Sample_12.odp new file mode 100644 index 0000000000000000000000000000000000000000..7c66252beaa45fc001b0a19dda558308e4a91052 GIT binary patch literal 12071 zcmb7qbx<7Nw)Nl+GdKhp+#P1{;I1J!1PHFdo#5{7?!ny&1PJc#?j9UM_;PR6tNZS+ z>izL`_o?pF)oWMv?tMwwwAW0&K~xr z^33!@!wO2w!()@PY@_niqsq(^%nPGzGUM{Y%BmH&#!v?fb@ zfC2yzNdo|Af1?_Iv2!-Hb7pn7wK><*j@@kqecd#ma0gL))Jk3_SSUPDYMEde(h`|K zmO3%qS4M^sz{5UgHOi{>>%ZnTE?ZX%|qzivqox^F&DpH z>C}>ypg9NPsgndTa8i7kn{}b}m?J2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2wC+iW#VBaQSq2{I{jdbe@2mr25>tRNMmBcpmM3k z&sok;%Owd`x$cjov45l$(=66sy?;Aj1(WXJ6UA(wnxL9u8`%san=>ho)M@RjQb6VEpJVr{ETiLKHFqaaz zY9AdW@pYZAB?*m_9HdsR(2B5lw~j6&yZ>;CvHw69XRgBo1}SikF!w2NAyWkf{(#2@ zZ{?vwC2V<=b!H_~7gH#XFsY*{p=;fIP~e((R#Os?yvdSsT&o-8 zL)hz8>c28M8ycp!p6Y!MM+1lb9#s|I_m0~%Xpw$xokE$zFx-h?`>93XQErh3D3FFcTNEWq z@xOCzC)(R%02Iw`ebl6X!$zq5-W9d&Kso`39Y&gF2pi7eO7JNvkgVOJc-8gAwiP-M zlL=4-~8$ucZ{*2t8zxCMxLcD2=B}5qtePJV8=s4~f09828LQaCqMaRP*uW&ojP|{zc&|K0lGn&4yrYml5 zxR1)BreB{`Q4ZYUe`=8Bi&vu@yourdK-K6Gg~7=0I`>!hM>8>8UAqPVC4lgtJVSU1 zl>oFDk-&G20C+~gC=4(J7=)YG1E=8r1BJIo zEP}#a3xi<+h7<1>0qv^xA}5K26SVpvWNE?BOT`CK3yR_uCi&?qf;~VKfV7xk=7Qk5 z5V$2HqH*`1iWqsYqPROiE<*`w#yWTfn*xLam+n4<>-RD2c|G2dOiTbDa`ag&de-Hnc6Z@aQf4X%312p>U z==dMc&OcHAG=BUCC4v6GZ6N=|{ZmT+4~`M*{}9&y8RDP%@_#~T0slYMW)*n^#DBpN Q|E^wtRkoCW>D7S$2Y0(mod5s; literal 0 HcmV?d00001 diff --git a/src/PhpPresentation/IOFactory.php b/src/PhpPresentation/IOFactory.php index a0741885c..5f94f157a 100644 --- a/src/PhpPresentation/IOFactory.php +++ b/src/PhpPresentation/IOFactory.php @@ -27,7 +27,7 @@ class IOFactory * * @var array */ - private static $autoResolveClasses = array('Serialized', 'PowerPoint97', 'PowerPoint2007'); + private static $autoResolveClasses = array('Serialized', 'ODPresentation', 'PowerPoint97', 'PowerPoint2007'); /** * Create writer diff --git a/src/PhpPresentation/Reader/ODPresentation.php b/src/PhpPresentation/Reader/ODPresentation.php new file mode 100644 index 000000000..97030f7cc --- /dev/null +++ b/src/PhpPresentation/Reader/ODPresentation.php @@ -0,0 +1,463 @@ +fileSupportsUnserializePhpPresentation($pFilename); + } + + /** + * Does a file support UnserializePhpPresentation ? + * + * @param string $pFilename + * @throws \Exception + * @return boolean + */ + public function fileSupportsUnserializePhpPresentation($pFilename = '') + { + // Check if file exists + if (!file_exists($pFilename)) { + throw new \Exception("Could not open " . $pFilename . " for reading! File does not exist."); + } + + $oZip = new ZipArchive(); + // Is it a zip ? + if ($oZip->open($pFilename) === true) { + // Is it an OpenXML Document ? + // Is it a Presentation ? + if (is_array($oZip->statName('META-INF/manifest.xml')) && is_array($oZip->statName('mimetype')) && $oZip->getFromName('mimetype') == 'application/vnd.oasis.opendocument.presentation') { + return true; + } + } + return false; + } + + /** + * Loads PhpPresentation Serialized file + * + * @param string $pFilename + * @return \PhpOffice\PhpPresentation\PhpPresentation + * @throws \Exception + */ + public function load($pFilename) + { + // Unserialize... First make sure the file supports it! + if (!$this->fileSupportsUnserializePhpPresentation($pFilename)) { + throw new \Exception("Invalid file format for PhpOffice\PhpPresentation\Reader\ODPresentation: " . $pFilename . "."); + } + + return $this->loadFile($pFilename); + } + + /** + * Load PhpPresentation Serialized file + * + * @param string $pFilename + * @return \PhpOffice\PhpPresentation\PhpPresentation + */ + protected function loadFile($pFilename) + { + $this->oPhpPresentation = new PhpPresentation(); + $this->oPhpPresentation->removeSlideByIndex(); + + $this->oZip = new ZipArchive(); + $this->oZip->open($pFilename); + + $this->oXMLReader = new XMLReader(); + if ($this->oXMLReader->getDomFromZip($pFilename, 'meta.xml') !== false) { + $this->loadDocumentProperties(); + } + $this->oXMLReader = new XMLReader(); + if ($this->oXMLReader->getDomFromZip($pFilename, 'content.xml') !== false) { + $this->loadSlides(); + } + + return $this->oPhpPresentation; + } + + /** + * Read Document Properties + */ + protected function loadDocumentProperties() + { + $arrayProperties = array( + '/office:document-meta/office:meta/meta:initial-creator' => 'setCreator', + '/office:document-meta/office:meta/dc:creator' => 'setLastModifiedBy', + '/office:document-meta/office:meta/dc:title' => 'setTitle', + '/office:document-meta/office:meta/dc:description' => 'setDescription', + '/office:document-meta/office:meta/dc:subject' => 'setSubject', + '/office:document-meta/office:meta/meta:keyword' => 'setKeywords', + '/office:document-meta/office:meta/meta:creation-date' => 'setCreated', + '/office:document-meta/office:meta/dc:date' => 'setModified', + ); + $oProperties = $this->oPhpPresentation->getProperties(); + foreach ($arrayProperties as $path => $property) { + if (is_object($oElement = $this->oXMLReader->getElement($path))) { + if (in_array($property, array('setCreated', 'setModified'))) { + $oDateTime = new \DateTime(); + $oDateTime->createFromFormat(\DateTime::W3C, $oElement->nodeValue); + $oProperties->{$property}($oDateTime->getTimestamp()); + } else { + $oProperties->{$property}($oElement->nodeValue); + } + } + } + } + + /** + * Extract all slides + */ + protected function loadSlides() + { + foreach ($this->oXMLReader->getElements('/office:document-content/office:automatic-styles/*') as $oElement) { + if ($oElement->hasAttribute('style:name')) { + $this->loadStyle($oElement); + } + } + foreach ($this->oXMLReader->getElements('/office:document-content/office:body/office:presentation/draw:page') as $oElement) { + if ($oElement->nodeName == 'draw:page') { + $this->loadSlide($oElement); + } + } + } + + /** + * Extract style + * @param \DOMElement $nodeStyle + */ + protected function loadStyle(\DOMElement $nodeStyle) + { + $keyStyle = $nodeStyle->getAttribute('style:name'); + + $nodeGraphicProperties = $this->oXMLReader->getElement('style:graphic-properties', $nodeStyle); + if ($nodeGraphicProperties) { + // Read Shadow + if ($nodeGraphicProperties->hasAttribute('draw:shadow') && $nodeGraphicProperties->getAttribute('draw:shadow') == 'visible') { + $oShadow = new Shadow(); + $oShadow->setVisible(true); + if ($nodeGraphicProperties->hasAttribute('draw:shadow-color')) { + $oShadow->getColor()->setRGB(substr($nodeGraphicProperties->getAttribute('draw:shadow-color'), -6)); + } + if ($nodeGraphicProperties->hasAttribute('draw:shadow-opacity')) { + $oShadow->setAlpha( 100 - (int)substr($nodeGraphicProperties->getAttribute('draw:shadow-opacity'), 0, -1)); + } + if ($nodeGraphicProperties->hasAttribute('draw:shadow-offset-x') && $nodeGraphicProperties->hasAttribute('draw:shadow-offset-y')) { + $offsetX = substr($nodeGraphicProperties->getAttribute('draw:shadow-offset-x'), 0, -2); + $offsetY = substr($nodeGraphicProperties->getAttribute('draw:shadow-offset-y'), 0, -2); + $distance = 0; + if ($offsetX != 0) { + $distance = ($offsetX < 0 ? $offsetX * -1 : $offsetX); + } elseif ($offsetY != 0) { + $distance = ($offsetY < 0 ? $offsetY * -1 : $offsetY); + } + $oShadow->setDirection(rad2deg(atan2($offsetY, $offsetX))); + $oShadow->setDistance(CommonDrawing::centimetersToPixels($distance)); + } + } + } + + $nodeTextProperties = $this->oXMLReader->getElement('style:text-properties', $nodeStyle); + if ($nodeTextProperties) { + $oFont = new Font(); + if ($nodeTextProperties->hasAttribute('fo:color')) { + $oFont->getColor()->setRGB(substr($nodeTextProperties->getAttribute('fo:color'), -6)); + } + if ($nodeTextProperties->hasAttribute('fo:font-family')) { + $oFont->setName($nodeTextProperties->getAttribute('fo:font-family')); + } + if ($nodeTextProperties->hasAttribute('fo:font-weight') && $nodeTextProperties->getAttribute('fo:font-weight') == 'bold') { + $oFont->setBold(true); + } + if ($nodeTextProperties->hasAttribute('fo:font-size')) { + $oFont->setSize(substr($nodeTextProperties->getAttribute('fo:font-size'), 0, -2)); + } + } + $nodeParagraphProperties = $this->oXMLReader->getElement('style:paragraph-properties', $nodeStyle); + if ($nodeParagraphProperties) { + $oAlignment = new Alignment(); + if ($nodeParagraphProperties->hasAttribute('fo:text-align')) { + $oAlignment->setHorizontal($nodeParagraphProperties->getAttribute('fo:text-align')); + } + } + + if ($nodeStyle->nodeName == 'text:list-style') { + $arrayListStyle = array(); + foreach ($this->oXMLReader->getElements('text:list-level-style-bullet' , $nodeStyle) as $oNodeListLevel) { + $oAlignment = new Alignment(); + $oBullet = new Bullet(); + $oBullet->setBulletType(Bullet::TYPE_NONE); + if ($oNodeListLevel->hasAttribute('text:level')) { + $oAlignment->setLevel((int) $oNodeListLevel->getAttribute('text:level') - 1); + } + if ($oNodeListLevel->hasAttribute('text:bullet-char')) { + $oBullet->setBulletChar($oNodeListLevel->getAttribute('text:bullet-char')); + $oBullet->setBulletType(Bullet::TYPE_BULLET); + } + + $oNodeListProperties = $this->oXMLReader->getElement('style:list-level-properties', $oNodeListLevel); + if ($oNodeListProperties) { + if ($oNodeListProperties->hasAttribute('text:min-label-width')) { + $oAlignment->setIndent((int)round(CommonDrawing::centimetersToPixels(substr($oNodeListProperties->getAttribute('text:min-label-width'), 0, -2)))); + } + if ($oNodeListProperties->hasAttribute('text:space-before')) { + $iSpaceBefore = CommonDrawing::centimetersToPixels(substr($oNodeListProperties->getAttribute('text:space-before'), 0, -2)); + $iMarginLeft = $iSpaceBefore + $oAlignment->getIndent(); + $oAlignment->setMarginLeft($iMarginLeft); + } + } + $oNodeTextProperties = $this->oXMLReader->getElement('style:text-properties', $oNodeListLevel); + if ($oNodeTextProperties) { + if ($oNodeTextProperties->hasAttribute('fo:font-family')) { + $oBullet->setBulletFont($oNodeTextProperties->getAttribute('fo:font-family')); + } + } + + $arrayListStyle[$oAlignment->getLevel()] = array( + 'alignment' => $oAlignment, + 'bullet' => $oBullet, + ); + } + } + + $this->arrayStyles[$keyStyle] = array( + 'alignment' => isset($oAlignment) ? $oAlignment : null, + 'font' => isset($oFont) ? $oFont : null, + 'shadow' => isset($oShadow) ? $oShadow : null, + 'listStyle' => isset($arrayListStyle) ? $arrayListStyle : null, + ); + + return true; + } + + /** + * Extract data from slide + * @param \DOMElement $nodeSlide + */ + protected function loadSlide(\DOMElement $nodeSlide) + { + // Core + $this->oPhpPresentation->createSlide(); + $this->oPhpPresentation->setActiveSlideIndex($this->oPhpPresentation->getSlideCount() - 1); + foreach ($this->oXMLReader->getElements('draw:frame', $nodeSlide) as $oNodeFrame) { + if ($this->oXMLReader->getElement('draw:image', $oNodeFrame)) { + $this->loadShapeDrawing($oNodeFrame); + continue; + } + if ($this->oXMLReader->getElement('draw:text-box', $oNodeFrame)) { + $this->loadShapeRichText($oNodeFrame); + continue; + } + } + return true; + } + + /** + * + * @param \DOMElement $oNodeFrame + */ + protected function loadShapeDrawing(\DOMElement $oNodeFrame) + { + // Core + $oShape = new MemoryDrawing(); + $oShape->getShadow()->setVisible(false); + + $oNodeImage = $this->oXMLReader->getElement('draw:image', $oNodeFrame); + if ($oNodeImage) { + if ($oNodeImage->hasAttribute('xlink:href')) { + $imageFile = $this->oZip->getFromName($oNodeImage->getAttribute('xlink:href')); + if (!empty($imageFile)) { + $oShape->setImageResource(imagecreatefromstring($imageFile)); + } + } + } + + $oShape->setName($oNodeFrame->hasAttribute('draw:name') ? $oNodeFrame->getAttribute('draw:name') : ''); + $oShape->setDescription($oNodeFrame->hasAttribute('draw:name') ? $oNodeFrame->getAttribute('draw:name') : ''); + $oShape->setResizeProportional(false); + $oShape->setWidth($oNodeFrame->hasAttribute('svg:width') ? (int)round(CommonDrawing::centimetersToPixels(substr($oNodeFrame->getAttribute('svg:width'), 0, -2))) : ''); + $oShape->setHeight($oNodeFrame->hasAttribute('svg:height') ? (int)round(CommonDrawing::centimetersToPixels(substr($oNodeFrame->getAttribute('svg:height'), 0, -2))) : ''); + $oShape->setResizeProportional(true); + $oShape->setOffsetX($oNodeFrame->hasAttribute('svg:x') ? (int)round(CommonDrawing::centimetersToPixels(substr($oNodeFrame->getAttribute('svg:x'), 0, -2))) : ''); + $oShape->setOffsetY($oNodeFrame->hasAttribute('svg:y') ? (int)round(CommonDrawing::centimetersToPixels(substr($oNodeFrame->getAttribute('svg:y'), 0, -2))) : ''); + + if ($oNodeFrame->hasAttribute('draw:style-name')) { + $keyStyle = $oNodeFrame->getAttribute('draw:style-name'); + if (isset($this->arrayStyles[$keyStyle])) { + $oShape->setShadow($this->arrayStyles[$keyStyle]['shadow']); + } + } + + $this->oPhpPresentation->getActiveSlide()->addShape($oShape); + } + + /** + * + * @param \DOMElement $oNodeFrame + */ + protected function loadShapeRichText(\DOMElement $oNodeFrame) + { + // Core + $oShape = $this->oPhpPresentation->getActiveSlide()->createRichTextShape(); + $oShape->setParagraphs(array()); + + $oShape->setWidth($oNodeFrame->hasAttribute('svg:width') ? (int)round(CommonDrawing::centimetersToPixels(substr($oNodeFrame->getAttribute('svg:width'), 0, -2))) : ''); + $oShape->setHeight($oNodeFrame->hasAttribute('svg:height') ? (int)round(CommonDrawing::centimetersToPixels(substr($oNodeFrame->getAttribute('svg:height'), 0, -2))) : ''); + $oShape->setOffsetX($oNodeFrame->hasAttribute('svg:x') ? (int)round(CommonDrawing::centimetersToPixels(substr($oNodeFrame->getAttribute('svg:x'), 0, -2))) : ''); + $oShape->setOffsetY($oNodeFrame->hasAttribute('svg:y') ? (int)round(CommonDrawing::centimetersToPixels(substr($oNodeFrame->getAttribute('svg:y'), 0, -2))) : ''); + + foreach ($this->oXMLReader->getElements('draw:text-box/*', $oNodeFrame) as $oNodeParagraph) { + $this->levelParagraph = 0; + if ($oNodeParagraph->nodeName == 'text:p') { + $this->readParagraph($oShape, $oNodeParagraph); + } + if ($oNodeParagraph->nodeName == 'text:list') { + $this->readList($oShape, $oNodeParagraph); + } + } + + if (count($oShape->getParagraphs()) > 0) { + $oShape->setActiveParagraph(0); + } + } + + protected $levelParagraph = 0; + + /** + * Read Paragraph + * @param RichText $oShape + * @param \DOMElement $oNodeParent + */ + protected function readParagraph(RichText $oShape, \DOMElement $oNodeParent) + { + $oParagraph = $oShape->createParagraph(); + foreach ($this->oXMLReader->getElements('text:span', $oNodeParent) as $oNodeRichTextElement) { + $this->readParagraphItem($oParagraph, $oNodeRichTextElement); + } + } + + /** + * Read Paragraph Item + * @param RichText $oShape + * @param \DOMElement $oNodeParent + */ + protected function readParagraphItem(Paragraph $oParagraph, \DOMElement $oNodeParent) + { + if ($this->oXMLReader->elementExists('text:line-break', $oNodeParent)) { + $oParagraph->createBreak(); + } else { + $oTextRun = $oParagraph->createTextRun(); + if ($oNodeParent->hasAttribute('text:style-name')) { + $keyStyle = $oNodeParent->getAttribute('text:style-name'); + if (isset($this->arrayStyles[$keyStyle])) { + $oTextRun->setFont($this->arrayStyles[$keyStyle]['font']); + } + } + if ($oTextRunLink = $this->oXMLReader->getElement('text:a', $oNodeParent)) { + $oTextRun->setText($oTextRunLink->nodeValue); + if ($oTextRunLink->hasAttribute('xlink:href')) { + $oTextRun->getHyperlink()->setUrl($oTextRunLink->getAttribute('xlink:href')); + } + } else { + $oTextRun->setText($oNodeParent->nodeValue); + } + } + } + + protected function readList(RichText $oShape, \DOMElement $oNodeParent) + { + foreach ($this->oXMLReader->getElements('text:list-item/*', $oNodeParent) as $oNodeListItem) { + if ($oNodeListItem->nodeName == 'text:p') { + $this->readListItem($oShape, $oNodeListItem, $oNodeParent); + } + if ($oNodeListItem->nodeName == 'text:list') { + $this->levelParagraph++; + $this->readList($oShape, $oNodeListItem); + $this->levelParagraph--; + } + } + } + + /** + * Read Paragraph + * @param RichText $oShape + * @param \DOMElement $oNodeParent + * @param \DOMElement $oNodeParagraph + */ + protected function readListItem(RichText $oShape, \DOMElement $oNodeParent, \DOMElement $oNodeParagraph) + { + $oParagraph = $oShape->createParagraph(); + if ($oNodeParagraph->hasAttribute('text:style-name')) { + $keyStyle = $oNodeParagraph->getAttribute('text:style-name'); + if (isset($this->arrayStyles[$keyStyle])) { + $oParagraph->setAlignment($this->arrayStyles[$keyStyle]['listStyle'][$this->levelParagraph]['alignment']); + $oParagraph->setBulletStyle($this->arrayStyles[$keyStyle]['listStyle'][$this->levelParagraph]['bullet']); + } + } + foreach ($this->oXMLReader->getElements('text:span', $oNodeParent) as $oNodeRichTextElement) { + $this->readParagraphItem($oParagraph, $oNodeRichTextElement); + } + } +} diff --git a/src/PhpPresentation/Reader/PowerPoint2007.php b/src/PhpPresentation/Reader/PowerPoint2007.php index e6f77f5dc..d36fbb3ef 100644 --- a/src/PhpPresentation/Reader/PowerPoint2007.php +++ b/src/PhpPresentation/Reader/PowerPoint2007.php @@ -130,38 +130,35 @@ protected function loadFile($pFilename) /** * Read Document Properties * @param string $sPart - * @return boolean */ protected function loadDocumentProperties($sPart) { $xmlReader = new XMLReader(); - if (!$xmlReader->getDomFromString($sPart)) { - return false; - } - $arrayProperties = array( - '/cp:coreProperties/dc:creator' => 'setCreator', - '/cp:coreProperties/cp:lastModifiedBy' => 'setLastModifiedBy', - '/cp:coreProperties/dc:title' => 'setTitle', - '/cp:coreProperties/dc:description' => 'setDescription', - '/cp:coreProperties/dc:subject' => 'setSubject', - '/cp:coreProperties/cp:keywords' => 'setKeywords', - '/cp:coreProperties/cp:category' => 'setCategory', - '/cp:coreProperties/dcterms:created' => 'setCreated', - '/cp:coreProperties/dcterms:modified' => 'setModified', - ); - $oProperties = $this->oPhpPresentation->getProperties(); - foreach ($arrayProperties as $path => $property) { - if (is_object($oElement = $xmlReader->getElement($path))) { - if ($oElement->hasAttribute('xsi:type') && $oElement->getAttribute('xsi:type') == 'dcterms:W3CDTF') { - $oDateTime = new \DateTime(); - $oDateTime->createFromFormat(\DateTime::W3C, $oElement->nodeValue); - $oProperties->{$property}($oDateTime->getTimestamp()); - } else { - $oProperties->{$property}($oElement->nodeValue); + if ($xmlReader->getDomFromString($sPart)) { + $arrayProperties = array( + '/cp:coreProperties/dc:creator' => 'setCreator', + '/cp:coreProperties/cp:lastModifiedBy' => 'setLastModifiedBy', + '/cp:coreProperties/dc:title' => 'setTitle', + '/cp:coreProperties/dc:description' => 'setDescription', + '/cp:coreProperties/dc:subject' => 'setSubject', + '/cp:coreProperties/cp:keywords' => 'setKeywords', + '/cp:coreProperties/cp:category' => 'setCategory', + '/cp:coreProperties/dcterms:created' => 'setCreated', + '/cp:coreProperties/dcterms:modified' => 'setModified', + ); + $oProperties = $this->oPhpPresentation->getProperties(); + foreach ($arrayProperties as $path => $property) { + if (is_object($oElement = $xmlReader->getElement($path))) { + if ($oElement->hasAttribute('xsi:type') && $oElement->getAttribute('xsi:type') == 'dcterms:W3CDTF') { + $oDateTime = new \DateTime(); + $oDateTime->createFromFormat(\DateTime::W3C, $oElement->nodeValue); + $oProperties->{$property}($oDateTime->getTimestamp()); + } else { + $oProperties->{$property}($oElement->nodeValue); + } } } } - return true; } /** @@ -185,7 +182,6 @@ protected function loadSlides($sPart) } } } - return true; } /** @@ -212,9 +208,7 @@ protected function loadSlide($sPart, $baseFile) //var_export($oNode->tagName); } } - //die(); } - return true; } /** diff --git a/src/PhpPresentation/Writer/ODPresentation/Content.php b/src/PhpPresentation/Writer/ODPresentation/Content.php index 027604216..9f4214c3c 100644 --- a/src/PhpPresentation/Writer/ODPresentation/Content.php +++ b/src/PhpPresentation/Writer/ODPresentation/Content.php @@ -1215,6 +1215,11 @@ public function writeStyleSlide(XMLWriter $objWriter, Slide $slide, $incPage) } + /** + * @param XMLWriter $objWriter + * @param Shadow $oShadow + * @todo Improve for supporting any direction (https://sinepost.wordpress.com/2012/02/16/theyve-got-atan-you-want-atan2/) + */ protected function writeStylePartShadow(XMLWriter $objWriter, Shadow $oShadow) { $objWriter->writeAttribute('draw:shadow', 'visible'); diff --git a/tests/PhpPresentation/Tests/Reader/ODPresentationTest.php b/tests/PhpPresentation/Tests/Reader/ODPresentationTest.php new file mode 100644 index 000000000..9b866fd4b --- /dev/null +++ b/tests/PhpPresentation/Tests/Reader/ODPresentationTest.php @@ -0,0 +1,467 @@ +assertFalse($object->canRead($file)); + + $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/serialized.phppt'; + $this->assertFalse($object->canRead($file)); + + $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_12.pptx'; + $this->assertFalse($object->canRead($file)); + + $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_12.odp'; + $this->assertTrue($object->canRead($file)); + } + + /** + * @expectedException \Exception + * @expectedExceptionMessage Could not open for reading! File does not exist. + */ + public function testLoadFileNotExists() + { + $object = new ODPresentation(); + $object->load(''); + } + + /** + * @expectedException \Exception + * @expectedExceptionMessage Invalid file format for PhpOffice\PhpPresentation\Reader\ODPresentation: + */ + public function testLoadFileBadFormat() + { + $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_00_01.ppt'; + $object = new ODPresentation(); + $object->load($file); + } + + /** + * @expectedException \Exception + * @expectedExceptionMessage Could not open for reading! File does not exist. + */ + public function testFileSupportsNotExists() + { + $object = new ODPresentation(); + $object->fileSupportsUnserializePhpPresentation(''); + } + + public function testLoadFile01() + { + $file = PHPPRESENTATION_TESTS_BASE_DIR . '/resources/files/Sample_12.odp'; + $object = new ODPresentation(); + $oPhpPresentation = $object->load($file); + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\PhpPresentation', $oPhpPresentation); + // Document Properties + $this->assertEquals('PHPOffice', $oPhpPresentation->getProperties()->getCreator()); + $this->assertEquals('PHPPresentation Team', $oPhpPresentation->getProperties()->getLastModifiedBy()); + $this->assertEquals('Sample 02 Title', $oPhpPresentation->getProperties()->getTitle()); + $this->assertEquals('Sample 02 Subject', $oPhpPresentation->getProperties()->getSubject()); + $this->assertEquals('Sample 02 Description', $oPhpPresentation->getProperties()->getDescription()); + $this->assertEquals('office 2007 openxml libreoffice odt php', $oPhpPresentation->getProperties()->getKeywords()); + // + $this->assertCount(4, $oPhpPresentation->getAllSlides()); + + // Slide 1 + $oSlide1 = $oPhpPresentation->getSlide(0); + $arrayShape = $oSlide1->getShapeCollection(); + $this->assertCount(2, $arrayShape); + // Slide 1 : Shape 1 + $oShape = $arrayShape[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\MemoryDrawing', $oShape); + $this->assertEquals('PHPPresentation logo', $oShape->getName()); + $this->assertEquals('PHPPresentation logo', $oShape->getDescription()); + $this->assertEquals(36, $oShape->getHeight()); + $this->assertEquals(10, $oShape->getOffsetX()); + $this->assertEquals(10, $oShape->getOffsetY()); + $this->assertTrue($oShape->getShadow()->isVisible()); + $this->assertEquals(45, $oShape->getShadow()->getDirection()); + $this->assertEquals(10, $oShape->getShadow()->getDistance()); + // Slide 1 : Shape 2 + $oShape = $arrayShape[1]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $oShape); + $this->assertEquals(200, $oShape->getHeight()); + $this->assertEquals(600, $oShape->getWidth()); + $this->assertEquals(10, $oShape->getOffsetX()); + $this->assertEquals(400, $oShape->getOffsetY()); + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oShape->getActiveParagraph()->getAlignment()->getHorizontal()); + $arrayParagraphs = $oShape->getParagraphs(); + $this->assertCount(1, $arrayParagraphs); + $oParagraph = $arrayParagraphs[0]; + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(3, $arrayRichText); + // Slide 1 : Shape 2 : Paragraph 1 + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('Introduction to', $oRichText->getText()); + $this->assertTrue($oRichText->getFont()->isBold()); + $this->assertEquals(28, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + // Slide 1 : Shape 2 : Paragraph 2 + $oRichText = $arrayRichText[1]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\BreakElement', $oRichText); + // Slide 1 : Shape 2 : Paragraph 3 + $oRichText = $arrayRichText[2]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('PHPPresentation', $oRichText->getText()); + $this->assertTrue($oRichText->getFont()->isBold()); + $this->assertEquals(60, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + + // Slide 2 + $oSlide2 = $oPhpPresentation->getSlide(1); + $arrayShape = $oSlide2->getShapeCollection(); + $this->assertCount(3, $arrayShape); + // Slide 2 : Shape 1 + $oShape = $arrayShape[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\MemoryDrawing', $oShape); + $this->assertEquals('PHPPresentation logo', $oShape->getName()); + $this->assertEquals('PHPPresentation logo', $oShape->getDescription()); + $this->assertEquals(36, $oShape->getHeight()); + $this->assertEquals(10, $oShape->getOffsetX()); + $this->assertEquals(10, $oShape->getOffsetY()); + $this->assertTrue($oShape->getShadow()->isVisible()); + $this->assertEquals(45, $oShape->getShadow()->getDirection()); + $this->assertEquals(10, $oShape->getShadow()->getDistance()); + // Slide 2 : Shape 2 + $oShape = $arrayShape[1]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $oShape); + $this->assertEquals(100, $oShape->getHeight()); + $this->assertEquals(930, $oShape->getWidth()); + $this->assertEquals(10, $oShape->getOffsetX()); + $this->assertEquals(50, $oShape->getOffsetY()); + $arrayParagraphs = $oShape->getParagraphs(); + $this->assertCount(1, $arrayParagraphs); + $oParagraph = $arrayParagraphs[0]; + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oParagraph->getAlignment()->getHorizontal()); + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + // Slide 2 : Shape 2 : Paragraph 1 + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('What is PHPPresentation?', $oRichText->getText()); + $this->assertTrue($oRichText->getFont()->isBold()); + $this->assertEquals(48, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + // Slide 2 : Shape 3 + $oShape = $arrayShape[2]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $oShape); + $this->assertEquals(600, $oShape->getHeight()); + $this->assertEquals(930, $oShape->getWidth()); + $this->assertEquals(10, $oShape->getOffsetX()); + $this->assertEquals(130, $oShape->getOffsetY()); + $arrayParagraphs = $oShape->getParagraphs(); + $this->assertCount(4, $arrayParagraphs); + // Slide 2 : Shape 3 : Paragraph 1 + $oParagraph = $arrayParagraphs[0]; + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oParagraph->getAlignment()->getHorizontal()); +// $this->assertEquals(25, $oParagraph->getAlignment()->getMarginLeft()); +// $this->assertEquals(-25, $oParagraph->getAlignment()->getIndent()); + $this->assertEquals(Bullet::TYPE_BULLET, $oParagraph->getBulletStyle()->getBulletType()); + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('A class library', $oRichText->getText()); + $this->assertEquals(36, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + // Slide 2 : Shape 3 : Paragraph 2 + $oParagraph = $arrayParagraphs[1]; + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oParagraph->getAlignment()->getHorizontal()); +// $this->assertEquals(25, $oParagraph->getAlignment()->getMarginLeft()); +// $this->assertEquals(-25, $oParagraph->getAlignment()->getIndent()); + $this->assertEquals(Bullet::TYPE_BULLET, $oParagraph->getBulletStyle()->getBulletType()); + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('Written in PHP', $oRichText->getText()); + $this->assertEquals(36, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + // Slide 2 : Shape 3 : Paragraph 3 + $oParagraph = $arrayParagraphs[2]; + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oParagraph->getAlignment()->getHorizontal()); +// $this->assertEquals(25, $oParagraph->getAlignment()->getMarginLeft()); +// $this->assertEquals(-25, $oParagraph->getAlignment()->getIndent()); + $this->assertEquals(Bullet::TYPE_BULLET, $oParagraph->getBulletStyle()->getBulletType()); + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('Representing a presentation', $oRichText->getText()); + $this->assertEquals(36, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + // Slide 2 : Shape 3 : Paragraph 4 + $oParagraph = $arrayParagraphs[3]; + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oParagraph->getAlignment()->getHorizontal()); +// $this->assertEquals(25, $oParagraph->getAlignment()->getMarginLeft()); +// $this->assertEquals(-25, $oParagraph->getAlignment()->getIndent()); + $this->assertEquals(Bullet::TYPE_BULLET, $oParagraph->getBulletStyle()->getBulletType()); + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('Supports writing to different file formats', $oRichText->getText()); + $this->assertEquals(36, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + + // Slide 3 + $oSlide2 = $oPhpPresentation->getSlide(2); + $arrayShape = $oSlide2->getShapeCollection(); + $this->assertCount(3, $arrayShape); + // Slide 3 : Shape 1 + $oShape = $arrayShape[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\MemoryDrawing', $oShape); + $this->assertEquals('PHPPresentation logo', $oShape->getName()); + $this->assertEquals('PHPPresentation logo', $oShape->getDescription()); + $this->assertEquals(36, $oShape->getHeight()); + $this->assertEquals(10, $oShape->getOffsetX()); + $this->assertEquals(10, $oShape->getOffsetY()); + $this->assertTrue($oShape->getShadow()->isVisible()); + $this->assertEquals(45, $oShape->getShadow()->getDirection()); + $this->assertEquals(10, $oShape->getShadow()->getDistance()); + // Slide 3 : Shape 2 + $oShape = $arrayShape[1]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $oShape); + $this->assertEquals(100, $oShape->getHeight()); + $this->assertEquals(930, $oShape->getWidth()); + $this->assertEquals(10, $oShape->getOffsetX()); + $this->assertEquals(50, $oShape->getOffsetY()); + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oShape->getActiveParagraph()->getAlignment()->getHorizontal()); + $arrayParagraphs = $oShape->getParagraphs(); + $this->assertCount(1, $arrayParagraphs); + $oParagraph = $arrayParagraphs[0]; + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + // Slide 3 : Shape 2 : Paragraph 1 + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('What\'s the point?', $oRichText->getText()); + $this->assertTrue($oRichText->getFont()->isBold()); + $this->assertEquals(48, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + // Slide 3 : Shape 2 + $oShape = $arrayShape[2]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $oShape); + $this->assertEquals(600, $oShape->getHeight()); + $this->assertEquals(930, $oShape->getWidth()); + $this->assertEquals(10, $oShape->getOffsetX()); + $this->assertEquals(130, $oShape->getOffsetY()); + $arrayParagraphs = $oShape->getParagraphs(); + $this->assertCount(8, $arrayParagraphs); + // Slide 3 : Shape 3 : Paragraph 1 + $oParagraph = $arrayParagraphs[0]; + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oParagraph->getAlignment()->getHorizontal()); +// $this->assertEquals(25, $oParagraph->getAlignment()->getMarginLeft()); +// $this->assertEquals(-25, $oParagraph->getAlignment()->getIndent()); + $this->assertEquals(0, $oParagraph->getAlignment()->getLevel()); + $this->assertEquals(Bullet::TYPE_BULLET, $oParagraph->getBulletStyle()->getBulletType()); + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('Generate slide decks', $oRichText->getText()); + $this->assertEquals(36, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + // Slide 3 : Shape 3 : Paragraph 2 + $oParagraph = $arrayParagraphs[1]; + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oParagraph->getAlignment()->getHorizontal()); +// $this->assertEquals(75, $oParagraph->getAlignment()->getMarginLeft()); +// $this->assertEquals(-25, $oParagraph->getAlignment()->getIndent()); + $this->assertEquals(1, $oParagraph->getAlignment()->getLevel()); + $this->assertEquals(Bullet::TYPE_BULLET, $oParagraph->getBulletStyle()->getBulletType()); + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('Represent business data', $oRichText->getText()); + $this->assertEquals(36, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + // Slide 3 : Shape 3 : Paragraph 3 + $oParagraph = $arrayParagraphs[2]; + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oParagraph->getAlignment()->getHorizontal()); +// $this->assertEquals(75, $oParagraph->getAlignment()->getMarginLeft()); +// $this->assertEquals(-25, $oParagraph->getAlignment()->getIndent()); + $this->assertEquals(1, $oParagraph->getAlignment()->getLevel()); + $this->assertEquals(Bullet::TYPE_BULLET, $oParagraph->getBulletStyle()->getBulletType()); + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('Show a family slide show', $oRichText->getText()); + $this->assertEquals(36, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + // Slide 3 : Shape 3 : Paragraph 4 + $oParagraph = $arrayParagraphs[3]; + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oParagraph->getAlignment()->getHorizontal()); +// $this->assertEquals(75, $oParagraph->getAlignment()->getMarginLeft()); +// $this->assertEquals(-25, $oParagraph->getAlignment()->getIndent()); + $this->assertEquals(1, $oParagraph->getAlignment()->getLevel()); + $this->assertEquals(Bullet::TYPE_BULLET, $oParagraph->getBulletStyle()->getBulletType()); + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('...', $oRichText->getText()); + $this->assertEquals(36, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + // Slide 3 : Shape 3 : Paragraph 5 + $oParagraph = $arrayParagraphs[4]; + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oParagraph->getAlignment()->getHorizontal()); +// $this->assertEquals(25, $oParagraph->getAlignment()->getMarginLeft()); +// $this->assertEquals(-25, $oParagraph->getAlignment()->getIndent()); + $this->assertEquals(0, $oParagraph->getAlignment()->getLevel()); + $this->assertEquals(Bullet::TYPE_BULLET, $oParagraph->getBulletStyle()->getBulletType()); + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('Export these to different formats', $oRichText->getText()); + $this->assertEquals(36, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + // Slide 3 : Shape 3 : Paragraph 6 + $oParagraph = $arrayParagraphs[5]; + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oParagraph->getAlignment()->getHorizontal()); +// $this->assertEquals(75, $oParagraph->getAlignment()->getMarginLeft()); +// $this->assertEquals(-25, $oParagraph->getAlignment()->getIndent()); + $this->assertEquals(1, $oParagraph->getAlignment()->getLevel()); + $this->assertEquals(Bullet::TYPE_BULLET, $oParagraph->getBulletStyle()->getBulletType()); + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('PHPPresentation 2007', $oRichText->getText()); + $this->assertEquals(36, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + // Slide 3 : Shape 3 : Paragraph 7 + $oParagraph = $arrayParagraphs[6]; + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oParagraph->getAlignment()->getHorizontal()); +// $this->assertEquals(75, $oParagraph->getAlignment()->getMarginLeft()); +// $this->assertEquals(-25, $oParagraph->getAlignment()->getIndent()); + $this->assertEquals(1, $oParagraph->getAlignment()->getLevel()); + $this->assertEquals(Bullet::TYPE_BULLET, $oParagraph->getBulletStyle()->getBulletType()); + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('Serialized', $oRichText->getText()); + $this->assertEquals(36, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + // Slide 3 : Shape 3 : Paragraph 8 + $oParagraph = $arrayParagraphs[7]; + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oParagraph->getAlignment()->getHorizontal()); +// $this->assertEquals(75, $oParagraph->getAlignment()->getMarginLeft()); +// $this->assertEquals(-25, $oParagraph->getAlignment()->getIndent()); + $this->assertEquals(1, $oParagraph->getAlignment()->getLevel()); + $this->assertEquals(Bullet::TYPE_BULLET, $oParagraph->getBulletStyle()->getBulletType()); + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('... (more to come) ...', $oRichText->getText()); + $this->assertEquals(36, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oRichText->getFont()->getColor()->getARGB()); + + // Slide 4 + $oSlide3 = $oPhpPresentation->getSlide(3); + $arrayShape = $oSlide3->getShapeCollection(); + $this->assertCount(3, $arrayShape); + // Slide 4 : Shape 1 + $oShape = $arrayShape[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\MemoryDrawing', $oShape); + $this->assertEquals('PHPPresentation logo', $oShape->getName()); + $this->assertEquals('PHPPresentation logo', $oShape->getDescription()); + $this->assertEquals(36, $oShape->getHeight()); + $this->assertEquals(10, $oShape->getOffsetX()); + $this->assertEquals(10, $oShape->getOffsetY()); + $this->assertTrue($oShape->getShadow()->isVisible()); + $this->assertEquals(45, $oShape->getShadow()->getDirection()); + $this->assertEquals(10, $oShape->getShadow()->getDistance()); + // Slide 4 : Shape 2 + $oShape = $arrayShape[1]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $oShape); + $this->assertEquals(100, $oShape->getHeight()); + $this->assertEquals(930, $oShape->getWidth()); + $this->assertEquals(10, $oShape->getOffsetX()); + $this->assertEquals(50, $oShape->getOffsetY()); + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oShape->getActiveParagraph()->getAlignment()->getHorizontal()); + $arrayParagraphs = $oShape->getParagraphs(); + $this->assertCount(1, $arrayParagraphs); + $oParagraph = $arrayParagraphs[0]; + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(1, $arrayRichText); + // Slide 4 : Shape 2 : Paragraph 1 + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('Need more info?', $oRichText->getText()); + $this->assertTrue($oRichText->getFont()->isBold()); + $this->assertEquals(48, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oShape->getActiveParagraph()->getFont()->getColor()->getARGB()); + // Slide 4 : Shape 3 + $oShape = $arrayShape[2]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText', $oShape); + $this->assertEquals(600, $oShape->getHeight()); + $this->assertEquals(930, $oShape->getWidth()); + $this->assertEquals(10, $oShape->getOffsetX()); + $this->assertEquals(130, $oShape->getOffsetY()); + $this->assertEquals(Alignment::HORIZONTAL_LEFT, $oShape->getActiveParagraph()->getAlignment()->getHorizontal()); + $arrayParagraphs = $oShape->getParagraphs(); + $this->assertCount(1, $arrayParagraphs); + $oParagraph = $arrayParagraphs[0]; + $arrayRichText = $oParagraph->getRichTextElements(); + $this->assertCount(3, $arrayRichText); + // Slide 4 : Shape 3 : Paragraph 1 + $oRichText = $arrayRichText[0]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('Check the project site on GitHub:', $oRichText->getText()); + $this->assertFalse($oRichText->getFont()->isBold()); + $this->assertEquals(36, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oShape->getActiveParagraph()->getFont()->getColor()->getARGB()); + // Slide 4 : Shape 3 : Paragraph 2 + $oRichText = $arrayRichText[1]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\BreakElement', $oRichText); + // Slide 4 : Shape 3 : Paragraph 3 + $oRichText = $arrayRichText[2]; + $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Run', $oRichText); + $this->assertEquals('https://github.com/PHPOffice/PHPPresentation/', $oRichText->getText()); + $this->assertFalse($oRichText->getFont()->isBold()); + $this->assertEquals(32, $oRichText->getFont()->getSize()); + $this->assertEquals('FF000000', $oShape->getActiveParagraph()->getFont()->getColor()->getARGB()); + $this->assertTrue($oRichText->hasHyperlink()); + $this->assertEquals('https://github.com/PHPOffice/PHPPresentation/', $oRichText->getHyperlink()->getUrl()); + //$this->assertEquals('PHPPresentation', $oRichText->getHyperlink()->getTooltip()); + } +} diff --git a/tests/resources/files/Sample_12.odp b/tests/resources/files/Sample_12.odp new file mode 100644 index 0000000000000000000000000000000000000000..7c66252beaa45fc001b0a19dda558308e4a91052 GIT binary patch literal 12071 zcmb7qbx<7Nw)Nl+GdKhp+#P1{;I1J!1PHFdo#5{7?!ny&1PJc#?j9UM_;PR6tNZS+ z>izL`_o?pF)oWMv?tMwwwAW0&K~xr z^33!@!wO2w!()@PY@_niqsq(^%nPGzGUM{Y%BmH&#!v?fb@ zfC2yzNdo|Af1?_Iv2!-Hb7pn7wK><*j@@kqecd#ma0gL))Jk3_SSUPDYMEde(h`|K zmO3%qS4M^sz{5UgHOi{>>%ZnTE?ZX%|qzivqox^F&DpH z>C}>ypg9NPsgndTa8i7kn{}b}m?J2*nIUDksONrj=E;C6@?rF?uC5NVq~p#rM+E_mRy#miUyeph zlbb$Dg+dy>*7HZvsq9)bu~}Xm zx2bhmAB*X!Jgg_SF=x4ME(db0eGEIkVKw1;U*9eJh{?bD{&GWjNxg}XKeco{Ku*(= zPis7;ebNATKM})z3Q)3Mq8VCs>Rp@>-1xcoq-*og$O~g2uCw? zV-Kpd=U*1fzEyj=0bD#dntJnixDU)(4fX~rDdWV>cG{Wz@l)uMY3Qv0G)hNl92^^} zT{U`Dt9cmnM)0CB>Ef$5XoI2NIDXn!X85~%X2f}wbmz#%lS>ox_8SM+8M=1PY{T50UlnUN-uCJl1f@LJepV2- z2SD|YtlkjU-RO)YFKVPJ(%!S~qvJQ9-iYZ(uUuZ{6FqH118<3b(#Tj;&^Ea&P2k+q z@^d;sA1foI1QNy=wI|fN>{w0r-LCJAI#Xm0q%_RrbMSPPlX@bNoiqmM3`ZhKaIG`- zGE8+b?(~Q+*P)i@RgM*Sl{`#_z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AqPVC4lgtJVSU1 zl>oFDk-&G20C+~gC=4(J7=)YG1E=8r1BJIo zEP}#a3xi<+h7<1>0qv^xA}5K26SVpvWNE?BOT`CK3yR_uCi&?qf;~VKfV7xk=7Qk5 z5V$2HqH*`1iWqsYqPROiE<*`w#yWTfn*xLam+n4<>-RD2c|G2dOiTbDa`ag&de-Hnc6Z@aQf4X%312p>U z==dMc&OcHAG=BUCC4v6GZ6N=|{ZmT+4~`M*{}9&y8RDP%@_#~T0slYMW)*n^#DBpN Q|E^wtRkoCW>D7S$2Y0(mod5s; literal 0 HcmV?d00001 From c1979d9563cd091bdc16a26791449447f3046b1f Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Mon, 3 Aug 2015 13:35:02 +0200 Subject: [PATCH 14/15] ODPresentation Reader : Initial Commit - GH-113 (Fix PHPCS) --- docs/intro.rst | 12 +++---- src/PhpPresentation/Reader/ODPresentation.php | 34 +++++++++---------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/docs/intro.rst b/docs/intro.rst index dc45b10be..1d01c9761 100644 --- a/docs/intro.rst +++ b/docs/intro.rst @@ -48,7 +48,7 @@ Writers +---------------------------+----------------------+--------+-------+-------+-------+ | **Element Shape** | Image | ✓ | ✓ | | | +---------------------------+----------------------+--------+-------+-------+-------+ -| | Hyperlink | ✓ | | | | +| | Hyperlink | ✓ | ✓ | | | +---------------------------+----------------------+--------+-------+-------+-------+ | | Line | ✓ | ✓ | | | +---------------------------+----------------------+--------+-------+-------+-------+ @@ -74,19 +74,19 @@ Readers +---------------------------+----------------------+--------+-------+-------+-------+-------+ | Features | | PPTX | ODP | HTML | PDF | PPT | +===========================+======================+========+=======+=======+=======+=======+ -| **Document Properties** | Standard | | | | | | +| **Document Properties** | Standard | ✓ | ✓ | | | | +---------------------------+----------------------+--------+-------+-------+-------+-------+ | | Custom | | | | | | +---------------------------+----------------------+--------+-------+-------+-------+-------+ -| **Element Shape** | Image | | | | | ✓ | +| **Element Shape** | Image | ✓ | ✓ | | | ✓ | +---------------------------+----------------------+--------+-------+-------+-------+-------+ -| | Hyperlink | | | | | ✓ | +| | Hyperlink | ✓ | ✓ | | | ✓ | +---------------------------+----------------------+--------+-------+-------+-------+-------+ -| | RichText | | | | | ✓ | +| | RichText | ✓ | ✓ | | | ✓ | +---------------------------+----------------------+--------+-------+-------+-------+-------+ | | Table | | | | | | +---------------------------+----------------------+--------+-------+-------+-------+-------+ -| | Text | | | | | ✓ | +| | Text | ✓ | ✓ | | | ✓ | +---------------------------+----------------------+--------+-------+-------+-------+-------+ | **Charts** | Bar3D | | | | | | +---------------------------+----------------------+--------+-------+-------+-------+-------+ diff --git a/src/PhpPresentation/Reader/ODPresentation.php b/src/PhpPresentation/Reader/ODPresentation.php index 97030f7cc..996c6258d 100644 --- a/src/PhpPresentation/Reader/ODPresentation.php +++ b/src/PhpPresentation/Reader/ODPresentation.php @@ -192,21 +192,21 @@ protected function loadStyle(\DOMElement $nodeStyle) { $keyStyle = $nodeStyle->getAttribute('style:name'); - $nodeGraphicProperties = $this->oXMLReader->getElement('style:graphic-properties', $nodeStyle); - if ($nodeGraphicProperties) { + $nodeGraphicProps = $this->oXMLReader->getElement('style:graphic-properties', $nodeStyle); + if ($nodeGraphicProps) { // Read Shadow - if ($nodeGraphicProperties->hasAttribute('draw:shadow') && $nodeGraphicProperties->getAttribute('draw:shadow') == 'visible') { + if ($nodeGraphicProps->hasAttribute('draw:shadow') && $nodeGraphicProps->getAttribute('draw:shadow') == 'visible') { $oShadow = new Shadow(); $oShadow->setVisible(true); - if ($nodeGraphicProperties->hasAttribute('draw:shadow-color')) { - $oShadow->getColor()->setRGB(substr($nodeGraphicProperties->getAttribute('draw:shadow-color'), -6)); + if ($nodeGraphicProps->hasAttribute('draw:shadow-color')) { + $oShadow->getColor()->setRGB(substr($nodeGraphicProps->getAttribute('draw:shadow-color'), -6)); } - if ($nodeGraphicProperties->hasAttribute('draw:shadow-opacity')) { - $oShadow->setAlpha( 100 - (int)substr($nodeGraphicProperties->getAttribute('draw:shadow-opacity'), 0, -1)); + if ($nodeGraphicProps->hasAttribute('draw:shadow-opacity')) { + $oShadow->setAlpha(100 - (int)substr($nodeGraphicProps->getAttribute('draw:shadow-opacity'), 0, -1)); } - if ($nodeGraphicProperties->hasAttribute('draw:shadow-offset-x') && $nodeGraphicProperties->hasAttribute('draw:shadow-offset-y')) { - $offsetX = substr($nodeGraphicProperties->getAttribute('draw:shadow-offset-x'), 0, -2); - $offsetY = substr($nodeGraphicProperties->getAttribute('draw:shadow-offset-y'), 0, -2); + if ($nodeGraphicProps->hasAttribute('draw:shadow-offset-x') && $nodeGraphicProps->hasAttribute('draw:shadow-offset-y')) { + $offsetX = substr($nodeGraphicProps->getAttribute('draw:shadow-offset-x'), 0, -2); + $offsetY = substr($nodeGraphicProps->getAttribute('draw:shadow-offset-y'), 0, -2); $distance = 0; if ($offsetX != 0) { $distance = ($offsetX < 0 ? $offsetX * -1 : $offsetX); @@ -235,17 +235,17 @@ protected function loadStyle(\DOMElement $nodeStyle) $oFont->setSize(substr($nodeTextProperties->getAttribute('fo:font-size'), 0, -2)); } } - $nodeParagraphProperties = $this->oXMLReader->getElement('style:paragraph-properties', $nodeStyle); - if ($nodeParagraphProperties) { + $nodeParagraphProps = $this->oXMLReader->getElement('style:paragraph-properties', $nodeStyle); + if ($nodeParagraphProps) { $oAlignment = new Alignment(); - if ($nodeParagraphProperties->hasAttribute('fo:text-align')) { - $oAlignment->setHorizontal($nodeParagraphProperties->getAttribute('fo:text-align')); + if ($nodeParagraphProps->hasAttribute('fo:text-align')) { + $oAlignment->setHorizontal($nodeParagraphProps->getAttribute('fo:text-align')); } } if ($nodeStyle->nodeName == 'text:list-style') { $arrayListStyle = array(); - foreach ($this->oXMLReader->getElements('text:list-level-style-bullet' , $nodeStyle) as $oNodeListLevel) { + foreach ($this->oXMLReader->getElements('text:list-level-style-bullet', $nodeStyle) as $oNodeListLevel) { $oAlignment = new Alignment(); $oBullet = new Bullet(); $oBullet->setBulletType(Bullet::TYPE_NONE); @@ -390,7 +390,7 @@ protected function loadShapeRichText(\DOMElement $oNodeFrame) * @param RichText $oShape * @param \DOMElement $oNodeParent */ - protected function readParagraph(RichText $oShape, \DOMElement $oNodeParent) + protected function readParagraph(RichText $oShape, \DOMElement $oNodeParent) { $oParagraph = $oShape->createParagraph(); foreach ($this->oXMLReader->getElements('text:span', $oNodeParent) as $oNodeRichTextElement) { @@ -446,7 +446,7 @@ protected function readList(RichText $oShape, \DOMElement $oNodeParent) * @param \DOMElement $oNodeParent * @param \DOMElement $oNodeParagraph */ - protected function readListItem(RichText $oShape, \DOMElement $oNodeParent, \DOMElement $oNodeParagraph) + protected function readListItem(RichText $oShape, \DOMElement $oNodeParent, \DOMElement $oNodeParagraph) { $oParagraph = $oShape->createParagraph(); if ($oNodeParagraph->hasAttribute('text:style-name')) { From 25591b50deb3b1104d3b7b3e943e92503e705b3c Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Thu, 8 Oct 2015 12:28:27 +0200 Subject: [PATCH 15/15] Version 0.5.0 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c94ea8df..91743ab13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # Changelog -## 0.5.0 - Not released +## 0.5.0 - 2015-10-08 ### Features - PowerPoint2007 Reader : Initial Commit - @Progi1984 GH-44