PhpOffice\PhpPresentation\PhpPresentation::addSlide PHP Method

addSlide() public method

Add slide
public addSlide ( Slide $slide = null ) : Slide
$slide Slide
return Slide
    public function addSlide(Slide $slide = null)
    {
        $this->slideCollection[] = $slide;
        return $slide;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  */
 public function testMethod()
 {
     $oPhpPresentation = new PhpPresentation();
     $oPhpPresentation->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());
 }