/** * Test create new instance */ public function testConstruct() { $object = new DocumentLayout(); $this->assertEquals('screen4x3', $object->getDocumentLayout()); $this->assertEquals(9144000, $object->getCX()); $this->assertEquals(6858000, $object->getCY()); $this->assertEquals(9144000 / 36000, $object->getLayoutXmilli()); $this->assertEquals(6858000 / 36000, $object->getLayoutYmilli()); }
public function testCY() { $value = rand(1, 100000); $object = new DocumentLayout(); $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCY($value)); $this->assertEquals($value, $object->getCY()); $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_CENTIMETER)); $this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_CENTIMETER)); $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_EMU)); $this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_EMU)); $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_INCH)); $this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_INCH)); $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_MILLIMETER)); $this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_MILLIMETER)); $this->assertEquals($value, $object->getLayoutYmilli()); $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_POINT)); $this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_POINT)); $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_PIXEL)); $this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_PIXEL)); $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setLayoutYmilli($value)); $this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_MILLIMETER)); $this->assertEquals($value, $object->getLayoutYmilli()); }