PhpOffice\PhpPresentation\Style\Alignment::getMarginLeft PHP Method

getMarginLeft() public method

Get margin left
public getMarginLeft ( ) : integer
return integer
    public function getMarginLeft()
    {
        return $this->marginLeft;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Test get/set margin left
  */
 public function testSetGetMarginLeft()
 {
     $object = new Alignment();
     // != Alignment::HORIZONTAL_GENERAL
     $object->setHorizontal(Alignment::HORIZONTAL_CENTER);
     $value = rand(1, 100);
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->setMarginLeft($value));
     $this->assertEquals(0, $object->getMarginLeft());
     $value = rand(-100, 0);
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->setMarginLeft($value));
     $this->assertEquals($value, $object->getMarginLeft());
     $object->setHorizontal(Alignment::HORIZONTAL_GENERAL);
     $value = rand(1, 100);
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->setMarginLeft($value));
     $this->assertEquals($value, $object->getMarginLeft());
     $value = rand(-100, 0);
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Alignment', $object->setMarginLeft($value));
     $this->assertEquals($value, $object->getMarginLeft());
 }