From cf96ea0e18496ebd302562e4bbd2045d301b004e Mon Sep 17 00:00:00 2001 From: Spike Ilacqua Date: Thu, 2 Oct 2014 08:33:53 -0600 Subject: [PATCH] Width/Height set/get tests --- tests/PhpWord/Tests/Style/SectionTest.php | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/PhpWord/Tests/Style/SectionTest.php b/tests/PhpWord/Tests/Style/SectionTest.php index 8e8c1e87..6ad52a6c 100644 --- a/tests/PhpWord/Tests/Style/SectionTest.php +++ b/tests/PhpWord/Tests/Style/SectionTest.php @@ -97,6 +97,34 @@ class SettingsTest extends \PHPUnit_Framework_TestCase $this->assertEquals($iVal, $oSettings->getMarginRight()); } + /** + * Set/get page width + */ + public function testPageWidth() + { + // Section Settings + $oSettings = new Section(); + + $this->assertEquals(11906, $oSettings->getPageSizeW()); + $iVal = rand(1, 1000); + $oSettings->setSettingValue('pageSizeW', $iVal); + $this->assertEquals($iVal, $oSettings->getPageSizeW()); + } + + /** + * Set/get page height + */ + public function testPageHeight() + { + // Section Settings + $oSettings = new Section(); + + $this->assertEquals(16838, $oSettings->getPageSizeH()); + $iVal = rand(1, 1000); + $oSettings->setSettingValue('pageSizeH', $iVal); + $this->assertEquals($iVal, $oSettings->getPageSizeH()); + } + /** * Set/get landscape orientation */