/** * @dataProvider provider */ public function testGetPaperWidthAndHeightByPaperFormat($paperFormat, $expected) { $paperWidth = PHPRtfLite_Paper_Format::getPaperWidthByPaperFormat($paperFormat); $this->assertEquals($expected['width'], $paperWidth); $paperHeight = PHPRtfLite_Paper_Format::getPaperHeightByPaperFormat($paperFormat); $this->assertEquals($expected['height'], $paperHeight); }
/** * Sets the paper format. * * @param string $paperFormat */ public function setPaperFormat($paperFormat) { $defaultUnit = PHPRtfLite_Unit::getGlobalUnit(); $paperWidth = PHPRtfLite_Paper_Format::getPaperWidthByPaperFormat($paperFormat); $this->_paperWidth = PHPRtfLite_Unit::convertTo($paperWidth, PHPRtfLite_Unit::UNIT_MM, $defaultUnit); $paperHeight = PHPRtfLite_Paper_Format::getPaperHeightByPaperFormat($paperFormat); $this->_paperHeight = PHPRtfLite_Unit::convertTo($paperHeight, PHPRtfLite_Unit::UNIT_MM, $defaultUnit); }