/** * Test for PMA_getHtmlFor1NFStep1 * * @return void */ public function testPMAGetHtmlFor1NFStep1() { $db = "PMA_db"; $table = "PMA_table"; $normalizedTo = '1nf'; $result = PMA_getHtmlFor1NFStep1($db, $table, $normalizedTo); $this->assertContains("<h3 class='center'>" . __('First step of normalization (1NF)') . "</h3>", $result); $this->assertContains("<div id='mainContent'", $result); $this->assertContains("<legend>" . __('Step 1.'), $result); $this->assertContains('<h4', $result); $this->assertContains('<p', $result); $this->assertContains("<select id='selectNonAtomicCol'", $result); $this->assertContains(PMA_getHtmlForColumnsList($db, $table, _pgettext('string types', 'String')), $result); }
$newtables = json_decode($_REQUEST['newTables']); $res = PMA_createNewTablesFor3NF($newtables, $db); $response->addJSON($res); exit; } if (isset($_POST['repeatingColumns'])) { $repeatingColumns = $_POST['repeatingColumns']; $newTable = $_POST['newTable']; $newColumn = $_POST['newColumn']; $primary_columns = $_POST['primary_columns']; $res = PMA_moveRepeatingGroup($repeatingColumns, $primary_columns, $newTable, $newColumn, $table, $db); $response->addJSON($res); exit; } if (isset($_REQUEST['step1'])) { $html = PMA_getHtmlFor1NFStep1($db, $table, $normalForm); $response->addHTML($html); } else { if (isset($_REQUEST['step2'])) { $res = PMA_getHtmlContentsFor1NFStep2($db, $table); $response->addJSON($res); } else { if (isset($_REQUEST['step3'])) { $res = PMA_getHtmlContentsFor1NFStep3($db, $table); $response->addJSON($res); } else { if (isset($_REQUEST['step4'])) { $res = PMA_getHtmlContentsFor1NFStep4($db, $table); $response->addJSON($res); } else { if (isset($_REQUEST['step']) && $_REQUEST['step'] == 2.1) {
/** * Test for PMA_getHtmlFor1NFStep1 * * @return void */ public function testPMAGetHtmlFor1NFStep1() { $db = "PMA_db"; $table = "PMA_table"; $normalizedTo = '1nf'; $result = PMA_getHtmlFor1NFStep1($db, $table, $normalizedTo); $this->assertContains("<h3 class='center'>" . __('First step of normalization (1NF)') . "</h3>", $result); $this->assertTag(array('tag' => 'div', 'id' => 'mainContent', 'descendant' => array('tag' => 'fieldset', 'child' => array('id' => 'extra', 'id' => 'newCols'))), $result); $this->assertContains("<legend>" . __('Step 1.'), $result); $this->assertTag(array('tag' => 'h4', 'tag' => "p"), $result); $this->assertTag(array('tag' => 'select', 'id' => "selectNonAtomicCol"), $result); $this->assertContains(PMA_getHtmlForColumnsList($db, $table, _pgettext('string types', 'String')), $result); }