PhpOffice\PhpPresentation\Slide::addAnimation PHP Method

addAnimation() public method

Add an animation to the slide
public addAnimation ( $animation ) : Slide
return Slide
    public function addAnimation($animation)
    {
        $this->animations[] = $animation;
        return $this;
    }

Usage Example

Example #1
0
 public function testAnimations()
 {
     $oStub = $this->getMockForAbstractClass('PhpOffice\\PhpPresentation\\Slide\\Animation');
     $object = new Slide();
     $this->assertInternalType('array', $object->getAnimations());
     $this->assertCount(0, $object->getAnimations());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide', $object->addAnimation($oStub));
     $this->assertInternalType('array', $object->getAnimations());
     $this->assertCount(1, $object->getAnimations());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide', $object->setAnimations());
     $this->assertInternalType('array', $object->getAnimations());
     $this->assertCount(0, $object->getAnimations());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide', $object->setAnimations(array($oStub)));
     $this->assertInternalType('array', $object->getAnimations());
     $this->assertCount(1, $object->getAnimations());
 }