PhpOffice\PhpPresentation\Slide\SlideMaster::addSlideLayout PHP Method

addSlideLayout() public method

Add slideLayout
public addSlideLayout ( SlideLayout $slideLayout = null ) : SlideLayout
$slideLayout SlideLayout
return SlideLayout
    public function addSlideLayout(SlideLayout $slideLayout = null)
    {
        $this->slideLayouts[] = $slideLayout;
        return $slideLayout;
    }

Usage Example

 public function testLayout()
 {
     $object = new SlideMaster();
     // Mock Post
     $mockSlideLayout = $this->getMockForAbstractClass('PhpOffice\\PhpPresentation\\Slide\\SlideLayout', array($object));
     $this->assertEmpty($object->getAllSlideLayouts());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\SlideLayout', $object->createSlideLayout());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\SlideLayout', $object->addSlideLayout($mockSlideLayout));
     $this->assertCount(2, $object->getAllSlideLayouts());
 }