/** * Tests for: * Layout::getLastVersion * Layout::getReportTitle * Layout::getPagePaperType * Layout::isUserPaperType * Layout::isPortraitPage * Layout::getPageSize * Layout::getSVG */ function test_getters_for_Layout_configuration() { $regular_paper_type_format = array('version' => '0.8.2', 'config' => array('title' => 'Report Title', 'page' => array('paper-type' => 'A4', 'orientation' => 'landscape')), 'svg' => '<svg></svg>'); $layout = new Layout($regular_paper_type_format, array()); $this->assertEquals('0.8.2', $layout->getLastVersion()); $this->assertEquals('Report Title', $layout->getReportTitle()); $this->assertEquals('A4', $layout->getPagePaperType()); $this->assertFalse($layout->isUserPaperType()); $this->assertFalse($layout->isPortraitPage()); $this->assertNull($layout->getPageSize()); $this->assertEquals('<svg></svg>', $layout->getSVG()); $user_paper_type_format = array('version' => '0.8.2', 'config' => array('title' => 'Report Title', 'page' => array('paper-type' => 'user', 'orientation' => 'landscape', 'width' => 100.9, 'height' => 999.9)), 'svg' => '<svg></svg>'); $layout = new Layout($user_paper_type_format, array()); $this->assertEquals('user', $layout->getPagePaperType()); $this->assertTrue($layout->isUserPaperType()); $this->assertEquals(array(100.9, 999.9), $layout->getPageSize()); }