} 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) { $res = PMA_getHtmlFor2NFstep1($db, $table); $response->addJSON($res); } else { if (isset($_REQUEST['step']) && $_REQUEST['step'] == 3.1) {
/** * Test for PMA_getHtmlContentsFor1NFStep2 * * @return void */ public function testPMAGetHtmlContentsFor1NFStep2() { $db = "PMA_db"; $table = "PMA_table1"; $result = PMA_getHtmlContentsFor1NFStep2($db, $table); $this->assertInternalType('array', $result); $this->assertArrayHasKey('legendText', $result); $this->assertArrayHasKey('headText', $result); $this->assertArrayHasKey('subText', $result); $this->assertArrayHasKey('hasPrimaryKey', $result); $this->assertArrayHasKey('extra', $result); $this->assertContains('<a href="#" id="createPrimaryKey">', $result['subText']); $this->assertContains('<a href="#" id="addNewPrimary">', $result['extra']); $this->assertEquals('0', $result['hasPrimaryKey']); $this->assertContains(__('Step 1.') . 2, $result['legendText']); $result1 = PMA_getHtmlContentsFor1NFStep2($db, 'PMA_table'); $this->assertEquals('1', $result1['hasPrimaryKey']); }