PhpOffice\PhpPresentation\Slide\Animation::addShape PHP Method

addShape() public method

public addShape ( AbstractShape $shape ) : Animation
$shape PhpOffice\PhpPresentation\AbstractShape
return Animation
    public function addShape(AbstractShape $shape)
    {
        $this->shapeCollection[] = $shape;
        return $this;
    }

Usage Example

 public function testShape()
 {
     $oStub = $this->getMockForAbstractClass('PhpOffice\\PhpPresentation\\AbstractShape');
     $object = new Animation();
     $this->assertInternalType('array', $object->getShapeCollection());
     $this->assertCount(0, $object->getShapeCollection());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\Animation', $object->addShape($oStub));
     $this->assertInternalType('array', $object->getShapeCollection());
     $this->assertCount(1, $object->getShapeCollection());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\Animation', $object->setShapeCollection());
     $this->assertInternalType('array', $object->getShapeCollection());
     $this->assertCount(0, $object->getShapeCollection());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\Animation', $object->setShapeCollection(array($oStub)));
     $this->assertInternalType('array', $object->getShapeCollection());
     $this->assertCount(1, $object->getShapeCollection());
 }
All Usage Examples Of PhpOffice\PhpPresentation\Slide\Animation::addShape