PhpOffice\PhpPresentation\Slide\Background\Image::getIndexedFilename PHP Method

getIndexedFilename() public method

Get indexed filename (using image index)
public getIndexedFilename ( $numSlide ) : string
return string
    public function getIndexedFilename($numSlide)
    {
        return 'background_' . $numSlide . '.' . $this->getExtension();
    }

Usage Example

Example #1
0
 public function testColor()
 {
     $object = new Image();
     $imagePath = PHPPRESENTATION_TESTS_BASE_DIR . DIRECTORY_SEPARATOR . 'resources' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'PhpPresentationLogo.png';
     $numSlide = rand(1, 100);
     $this->assertNull($object->getPath());
     $this->assertEmpty($object->getFilename());
     $this->assertEmpty($object->getExtension());
     $this->assertEquals('background_' . $numSlide . '.', $object->getIndexedFilename($numSlide));
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\Background\\Image', $object->setPath($imagePath));
     $this->assertEquals($imagePath, $object->getPath());
     $this->assertEquals('PhpPresentationLogo.png', $object->getFilename());
     $this->assertEquals('png', $object->getExtension());
     $this->assertEquals('background_' . $numSlide . '.png', $object->getIndexedFilename($numSlide));
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Slide\\Background\\Image', $object->setPath(null, false));
     $this->assertNull($object->getPath());
     $this->assertEmpty($object->getFilename());
     $this->assertEmpty($object->getExtension());
     $this->assertEquals('background_' . $numSlide . '.', $object->getIndexedFilename($numSlide));
 }
All Usage Examples Of PhpOffice\PhpPresentation\Slide\Background\Image::getIndexedFilename