예제 #1
0
 public function testTimeTrigger()
 {
     $object = new Transition();
     $this->assertFalse($object->hasTimeTrigger());
     $this->assertNull($object->getAdvanceTimeTrigger());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\Transition', $object->setTimeTrigger());
     $this->assertFalse($object->hasTimeTrigger());
     $this->assertNull($object->getAdvanceTimeTrigger());
     $value = rand(1, 1000);
     $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\\PhpPresentation\\Slide\\Transition', $object->setTimeTrigger(null, $value));
     $this->assertTrue($object->hasTimeTrigger());
     $this->assertEquals($value, $object->getAdvanceTimeTrigger());
     $value = rand(1, 1000);
     $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\\PhpPresentation\\Slide\\Transition', $object->setTimeTrigger(null, $value));
     $this->assertFalse($object->hasTimeTrigger());
     $this->assertNull($object->getAdvanceTimeTrigger());
 }
예제 #2
0
 public function testTransition()
 {
     $value = rand(1000, 5000);
     $oTransition = new Transition();
     $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($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($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'));
     $this->assertStringEndsWith('S', $pres->getElementAttribute($element, 'presentation:duration', 'content.xml'));
     $this->assertContains(number_format($value / 1000, 6, '.', ''), $pres->getElementAttribute($element, 'presentation:duration', 'content.xml'));
     $this->assertContains('automatic', $pres->getElementAttribute($element, 'presentation:transition-type', 'content.xml'));
     $oTransition->setSpeed(Transition::SPEED_FAST);
     $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation');
     $this->assertContains('fast', $pres->getElementAttribute($element, 'presentation:transition-speed', 'content.xml'));
     $oTransition->setSpeed(Transition::SPEED_MEDIUM);
     $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation');
     $this->assertContains('medium', $pres->getElementAttribute($element, 'presentation:transition-speed', 'content.xml'));
     $oTransition->setSpeed(Transition::SPEED_SLOW);
     $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation');
     $this->assertContains('slow', $pres->getElementAttribute($element, 'presentation:transition-speed', 'content.xml'));
     $rcTransition = new \ReflectionClass('PhpOffice\\PhpPresentation\\Slide\\Transition');
     $arrayConstants = $rcTransition->getConstants();
     foreach ($arrayConstants as $key => $value) {
         if (strpos($key, 'TRANSITION_') !== 0) {
             continue;
         }
         $oTransition->setTransitionType($rcTransition->getConstant($key));
         $oSlide->setTransition($oTransition);
         $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation');
         switch ($key) {
             case 'TRANSITION_BLINDS_HORIZONTAL':
                 $this->assertContains('horizontal-stripes', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_BLINDS_VERTICAL':
                 $this->assertContains('vertical-stripes', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_CHECKER_HORIZONTAL':
                 $this->assertContains('horizontal-checkerboard', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_CHECKER_VERTICAL':
                 $this->assertContains('vertical-checkerboard', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_CIRCLE_HORIZONTAL':
                 $this->assertContains('none', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_CIRCLE_VERTICAL':
                 $this->assertContains('none', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_COMB_HORIZONTAL':
                 $this->assertContains('none', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_COMB_VERTICAL':
                 $this->assertContains('none', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_COVER_DOWN':
                 $this->assertContains('uncover-to-bottom', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_COVER_LEFT':
                 $this->assertContains('uncover-to-left', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_COVER_LEFT_DOWN':
                 $this->assertContains('uncover-to-lowerleft', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_COVER_LEFT_UP':
                 $this->assertContains('uncover-to-upperleft', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_COVER_RIGHT':
                 $this->assertContains('uncover-to-right', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_COVER_RIGHT_DOWN':
                 $this->assertContains('uncover-to-lowerright', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_COVER_RIGHT_UP':
                 $this->assertContains('uncover-to-upperright', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_COVER_UP':
                 $this->assertContains('uncover-to-top', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_CUT':
                 $this->assertContains('none', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_DIAMOND':
                 $this->assertContains('none', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_DISSOLVE':
                 $this->assertContains('dissolve', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_FADE':
                 $this->assertContains('fade-from-center', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_NEWSFLASH':
                 $this->assertContains('none', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_PLUS':
                 $this->assertContains('close', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_PULL_DOWN':
                 $this->assertContains('stretch-from-bottom', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_PULL_LEFT':
                 $this->assertContains('stretch-from-left', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_PULL_RIGHT':
                 $this->assertContains('stretch-from-right', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_PULL_UP':
                 $this->assertContains('stretch-from-top', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_PUSH_DOWN':
                 $this->assertContains('roll-from-bottom', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_PUSH_LEFT':
                 $this->assertContains('roll-from-left', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_PUSH_RIGHT':
                 $this->assertContains('roll-from-right', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_PUSH_UP':
                 $this->assertContains('roll-from-top', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_RANDOM':
                 $this->assertContains('random', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_RANDOMBAR_HORIZONTAL':
                 $this->assertContains('horizontal-lines', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_RANDOMBAR_VERTICAL':
                 $this->assertContains('vertical-lines', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_SPLIT_IN_HORIZONTAL':
                 $this->assertContains('close-horizontal', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_SPLIT_OUT_HORIZONTAL':
                 $this->assertContains('open-horizontal', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_SPLIT_IN_VERTICAL':
                 $this->assertContains('close-vertical', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_SPLIT_OUT_VERTICAL':
                 $this->assertContains('open-vertical', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_STRIPS_LEFT_DOWN':
                 $this->assertContains('none', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_STRIPS_LEFT_UP':
                 $this->assertContains('none', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_STRIPS_RIGHT_DOWN':
                 $this->assertContains('none', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_STRIPS_RIGHT_UP':
                 $this->assertContains('none', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_WEDGE':
                 $this->assertContains('none', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_WIPE_DOWN':
                 $this->assertContains('fade-from-bottom', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_WIPE_LEFT':
                 $this->assertContains('fade-from-left', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_WIPE_RIGHT':
                 $this->assertContains('fade-from-right', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_WIPE_UP':
                 $this->assertContains('fade-from-top', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_ZOOM_IN':
                 $this->assertContains('none', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
             case 'TRANSITION_ZOOM_OUT':
                 $this->assertContains('none', $pres->getElementAttribute($element, 'presentation:transition-style', 'content.xml'));
                 break;
         }
     }
     $oTransition->setTimeTrigger(false);
     $oTransition->setManualTrigger(true);
     $pres = TestHelperDOCX::getDocument($phpPresentation, 'ODPresentation');
     $this->assertContains('manual', $pres->getElementAttribute($element, 'presentation:transition-type', 'content.xml'));
 }
예제 #3
0
 public function testTransition()
 {
     $value = rand(1000, 5000);
     $oTransition = new Transition();
     $oPhpPresentation = new PhpPresentation();
     $oSlide = $oPhpPresentation->getActiveSlide();
     $element = '/p:sld/p:transition';
     $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007');
     $this->assertFalse($pres->elementExists($element, 'ppt/slides/slide1.xml'));
     $oTransition->setTimeTrigger(true, $value);
     $oSlide->setTransition($oTransition);
     $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($oPhpPresentation, 'PowerPoint2007');
     $this->assertContains('fast', $pres->getElementAttribute($element, 'spd', 'ppt/slides/slide1.xml'));
     $oTransition->setSpeed(Transition::SPEED_MEDIUM);
     $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007');
     $this->assertContains('med', $pres->getElementAttribute($element, 'spd', 'ppt/slides/slide1.xml'));
     $oTransition->setSpeed(Transition::SPEED_SLOW);
     $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007');
     $this->assertContains('slow', $pres->getElementAttribute($element, 'spd', 'ppt/slides/slide1.xml'));
     $rcTransition = new \ReflectionClass('PhpOffice\\PhpPresentation\\Slide\\Transition');
     $arrayConstants = $rcTransition->getConstants();
     foreach ($arrayConstants as $key => $value) {
         if (strpos($key, 'TRANSITION_') !== 0) {
             continue;
         }
         $oTransition->setTransitionType($rcTransition->getConstant($key));
         $oSlide->setTransition($oTransition);
         $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007');
         switch ($key) {
             case 'TRANSITION_BLINDS_HORIZONTAL':
                 $this->assertTrue($pres->elementExists($element . '/p:blinds[@dir=\'horz\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_BLINDS_VERTICAL':
                 $this->assertTrue($pres->elementExists($element . '/p:blinds[@dir=\'vert\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_CHECKER_HORIZONTAL':
                 $this->assertTrue($pres->elementExists($element . '/p:checker[@dir=\'horz\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_CHECKER_VERTICAL':
                 $this->assertTrue($pres->elementExists($element . '/p:checker[@dir=\'vert\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_CIRCLE_HORIZONTAL':
                 $this->assertTrue($pres->elementExists($element . '/p:circle[@dir=\'horz\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_CIRCLE_VERTICAL':
                 $this->assertTrue($pres->elementExists($element . '/p:circle[@dir=\'vert\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_COMB_HORIZONTAL':
                 $this->assertTrue($pres->elementExists($element . '/p:comb[@dir=\'horz\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_COMB_VERTICAL':
                 $this->assertTrue($pres->elementExists($element . '/p:comb[@dir=\'vert\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_COVER_DOWN':
                 $this->assertTrue($pres->elementExists($element . '/p:cover[@dir=\'d\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_COVER_LEFT':
                 $this->assertTrue($pres->elementExists($element . '/p:cover[@dir=\'l\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_COVER_LEFT_DOWN':
                 $this->assertTrue($pres->elementExists($element . '/p:cover[@dir=\'ld\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_COVER_LEFT_UP':
                 $this->assertTrue($pres->elementExists($element . '/p:cover[@dir=\'lu\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_COVER_RIGHT':
                 $this->assertTrue($pres->elementExists($element . '/p:cover[@dir=\'r\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_COVER_RIGHT_DOWN':
                 $this->assertTrue($pres->elementExists($element . '/p:cover[@dir=\'rd\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_COVER_RIGHT_UP':
                 $this->assertTrue($pres->elementExists($element . '/p:cover[@dir=\'ru\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_COVER_UP':
                 $this->assertTrue($pres->elementExists($element . '/p:cover[@dir=\'u\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_CUT':
                 $this->assertTrue($pres->elementExists($element . '/p:cut', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_DIAMOND':
                 $this->assertTrue($pres->elementExists($element . '/p:diamond', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_DISSOLVE':
                 $this->assertTrue($pres->elementExists($element . '/p:dissolve', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_FADE':
                 $this->assertTrue($pres->elementExists($element . '/p:fade', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_NEWSFLASH':
                 $this->assertTrue($pres->elementExists($element . '/p:newsflash', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_PLUS':
                 $this->assertTrue($pres->elementExists($element . '/p:plus', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_PULL_DOWN':
                 $this->assertTrue($pres->elementExists($element . '/p:pull[@dir=\'d\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_PULL_LEFT':
                 $this->assertTrue($pres->elementExists($element . '/p:pull[@dir=\'l\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_PULL_RIGHT':
                 $this->assertTrue($pres->elementExists($element . '/p:pull[@dir=\'r\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_PULL_UP':
                 $this->assertTrue($pres->elementExists($element . '/p:pull[@dir=\'u\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_PUSH_DOWN':
                 $this->assertTrue($pres->elementExists($element . '/p:push[@dir=\'d\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_PUSH_LEFT':
                 $this->assertTrue($pres->elementExists($element . '/p:push[@dir=\'l\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_PUSH_RIGHT':
                 $this->assertTrue($pres->elementExists($element . '/p:push[@dir=\'r\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_PUSH_UP':
                 $this->assertTrue($pres->elementExists($element . '/p:push[@dir=\'u\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_RANDOM':
                 $this->assertTrue($pres->elementExists($element . '/p:random', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_RANDOMBAR_HORIZONTAL':
                 $this->assertTrue($pres->elementExists($element . '/p:randomBar[@dir=\'horz\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_RANDOMBAR_VERTICAL':
                 $this->assertTrue($pres->elementExists($element . '/p:randomBar[@dir=\'vert\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_SPLIT_IN_HORIZONTAL':
                 $this->assertTrue($pres->elementExists($element . '/p:split[@dir=\'in\'][@orient=\'horz\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_SPLIT_OUT_HORIZONTAL':
                 $this->assertTrue($pres->elementExists($element . '/p:split[@dir=\'out\'][@orient=\'horz\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_SPLIT_IN_VERTICAL':
                 $this->assertTrue($pres->elementExists($element . '/p:split[@dir=\'in\'][@orient=\'vert\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_SPLIT_OUT_VERTICAL':
                 $this->assertTrue($pres->elementExists($element . '/p:split[@dir=\'out\'][@orient=\'vert\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_STRIPS_LEFT_DOWN':
                 $this->assertTrue($pres->elementExists($element . '/p:strips[@dir=\'ld\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_STRIPS_LEFT_UP':
                 $this->assertTrue($pres->elementExists($element . '/p:strips[@dir=\'lu\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_STRIPS_RIGHT_DOWN':
                 $this->assertTrue($pres->elementExists($element . '/p:strips[@dir=\'rd\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_STRIPS_RIGHT_UP':
                 $this->assertTrue($pres->elementExists($element . '/p:strips[@dir=\'ru\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_WEDGE':
                 $this->assertTrue($pres->elementExists($element . '/p:wedge', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_WIPE_DOWN':
                 $this->assertTrue($pres->elementExists($element . '/p:wipe[@dir=\'d\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_WIPE_LEFT':
                 $this->assertTrue($pres->elementExists($element . '/p:wipe[@dir=\'l\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_WIPE_RIGHT':
                 $this->assertTrue($pres->elementExists($element . '/p:wipe[@dir=\'r\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_WIPE_UP':
                 $this->assertTrue($pres->elementExists($element . '/p:wipe[@dir=\'u\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_ZOOM_IN':
                 $this->assertTrue($pres->elementExists($element . '/p:zoom[@dir=\'in\']', 'ppt/slides/slide1.xml'));
                 break;
             case 'TRANSITION_ZOOM_OUT':
                 $this->assertTrue($pres->elementExists($element . '/p:zoom[@dir=\'out\']', 'ppt/slides/slide1.xml'));
                 break;
         }
     }
     $oTransition->setManualTrigger(true);
     $pres = TestHelperDOCX::getDocument($oPhpPresentation, 'PowerPoint2007');
     $this->assertContains('1', $pres->getElementAttribute($element, 'advClick', 'ppt/slides/slide1.xml'));
 }
$objPHPPresentation->getDocumentProperties()->setCreator('PHPOffice')->setLastModifiedBy('PHPPresentation Team')->setTitle('Sample 10 Title')->setSubject('Sample 10 Subject')->setDescription('Sample 10 Description')->setKeywords('office 2007 openxml libreoffice odt php')->setCategory('Sample Category');
// Create slide
echo date('H:i:s') . ' Create slide' . EOL;
$slide0 = $objPHPPresentation->getActiveSlide();
// Create a shape (drawing)
echo date('H:i:s') . ' Create a shape (drawing)' . EOL;
$shapeDrawing = $slide0->createDrawingShape();
$shapeDrawing->setName('PHPPresentation logo')->setDescription('PHPPresentation logo')->setPath('./resources/phppowerpoint_logo.gif')->setHeight(36)->setOffsetX(10)->setOffsetY(10);
$shapeDrawing->getShadow()->setVisible(true)->setDirection(45)->setDistance(10);
$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;
$shapeRichText = $slide0->createRichTextShape()->setHeight(300)->setWidth(600)->setOffsetX(170)->setOffsetY(180);
$shapeRichText->getActiveParagraph()->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER);
$textRun = $shapeRichText->createTextRun('Thank you for using PHPPresentation!');
$textRun->getFont()->setBold(true)->setSize(60)->setColor(new Color('FFE06B20'));
$oTransition = new Transition();
$oTransition->setManualTrigger(false);
$oTransition->setTimeTrigger(true, 4000);
$oTransition->setTransitionType(Transition::TRANSITION_SPLIT_IN_VERTICAL);
$slide0->setTransition($oTransition);
// Create slide
echo date('H:i:s') . ' Create slide' . EOL;
$slide1 = $objPHPPresentation->createSlide();
$slide1->addShape(clone $shapeDrawing);
$slide1->addShape(clone $shapeRichText);
// Save file
echo write($objPHPPresentation, basename(__FILE__, '.php'), $writers);
if (!CLI) {
    include_once 'Sample_Footer.php';
}