From 23b9fe22c62638f72f8cd63cb9f67e7dc68711ce Mon Sep 17 00:00:00 2001 From: adamgsoc2013 Date: Wed, 12 Jun 2013 00:00:48 +0800 Subject: [PATCH] add test case for Export_Relation_Schema class --- .../schema/Export_Relation_Schema_test.php | 250 ++++++++++++++++++ 1 file changed, 250 insertions(+) create mode 100644 test/classes/schema/Export_Relation_Schema_test.php diff --git a/test/classes/schema/Export_Relation_Schema_test.php b/test/classes/schema/Export_Relation_Schema_test.php new file mode 100644 index 0000000000..2174e249e0 --- /dev/null +++ b/test/classes/schema/Export_Relation_Schema_test.php @@ -0,0 +1,250 @@ +object = new PMA_Export_Relation_Schema(); + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + * + * @access protected + * @return void + */ + protected function tearDown() + { + unset($this->object); + } + + /** + * Test for setPageNumber + * + * @return void + * + * @group medium + */ + public function testSetPageNumbere() + { + $this->object->setPageNumber(33); + $this->assertEquals( + 33, + $this->object->pageNumber + ); + } + + /** + * Test for setShowGrid + * + * @return void + * + * @group medium + */ + public function testSetShowGrid() + { + $this->object->setShowGrid('on'); + $this->assertEquals( + 1, + $this->object->showGrid + ); + $this->object->setShowGrid('off'); + $this->assertEquals( + 0, + $this->object->showGrid + ); + } + + /** + * Test for setExportType + * + * @return void + * + * @group medium + */ + public function testSetExportType() + { + $this->object->setExportType('PMA_ExportType'); + $this->assertEquals( + 'PMA_ExportType', + $this->object->exportType + ); + } + + /** + * Test for setShowColor + * + * @return void + * + * @group medium + */ + public function testSetShowColor() + { + $this->object->setShowColor('on'); + $this->assertEquals( + 1, + $this->object->showColor + ); + $this->object->setShowColor('off'); + $this->assertEquals( + 0, + $this->object->showColor + ); + } + + /** + * Test for setOrientation + * + * @return void + * + * @group medium + */ + public function testSetOrientation() + { + $this->object->setOrientation('P'); + $this->assertEquals( + 'P', + $this->object->orientation + ); + $this->object->setOrientation('A'); + $this->assertEquals( + 'L', + $this->object->orientation + ); + } + + /** + * Test for setTableDimension + * + * @return void + * + * @group medium + */ + public function testSetTableDimension() + { + $this->object->setTableDimension('on'); + $this->assertEquals( + 1, + $this->object->tableDimension + ); + $this->object->setTableDimension('off'); + $this->assertEquals( + 0, + $this->object->tableDimension + ); + } + + /** + * Test for setPaper + * + * @return void + * + * @group medium + */ + public function testSetPaper() + { + $this->object->setPaper('A5'); + $this->assertEquals( + 'A5', + $this->object->paper + ); + $this->object->setPaper('A4'); + $this->assertEquals( + 'A4', + $this->object->paper + ); + } + + /** + * Test for setAllTablesSameWidth + * + * @return void + * + * @group medium + */ + public function testSetAllTablesSameWidth() + { + $this->object->setAllTablesSameWidth('on'); + $this->assertEquals( + 1, + $this->object->sameWide + ); + $this->object->setAllTablesSameWidth('off'); + $this->assertEquals( + 0, + $this->object->sameWide + ); + } + + /** + * Test for setWithDataDictionary + * + * @return void + * + * @group medium + */ + public function testSetWithDataDictionary() + { + $this->object->setWithDataDictionary('on'); + $this->assertEquals( + 1, + $this->object->withDoc + ); + $this->object->setWithDataDictionary('off'); + $this->assertEquals( + 0, + $this->object->withDoc + ); + } + + /** + * Test for setShowKeys + * + * @return void + * + * @group medium + */ + public function testSetShowKeys() + { + $this->object->setShowKeys('on'); + $this->assertEquals( + 1, + $this->object->showKeys + ); + $this->object->setShowKeys('off'); + $this->assertEquals( + 0, + $this->object->showKeys + ); + } +} + +