/**
  * Test for PMA_getHtmlFor2NFstep1
  *
  * @return void
  */
 public function testPMAGetHtmlFor2NFstep1()
 {
     $db = "PMA_db";
     $table = "PMA_table";
     $result = PMA_getHtmlFor2NFstep1($db, $table);
     $this->assertInternalType('array', $result);
     $this->assertArrayHasKey('legendText', $result);
     $this->assertArrayHasKey('headText', $result);
     $this->assertArrayHasKey('subText', $result);
     $this->assertArrayHasKey('extra', $result);
     $this->assertArrayHasKey('primary_key', $result);
     $this->assertContains(__('Step 2.') . 1, $result['legendText']);
     $this->assertEquals('id', $result['primary_key']);
     $result1 = PMA_getHtmlFor2NFstep1($db, "PMA_table2");
     $this->assertEquals('id, col1', $result1['primary_key']);
     $this->assertContains('<a href="#" id="showPossiblePd"', $result1['headText']);
     $this->assertContains('<input type="checkbox" name="pd" value="id"', $result1['extra']);
 }
Exemple #2
0
    $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) {
                        $tables = $_REQUEST['tables'];
                        $res = PMA_getHtmlFor3NFstep1($db, $tables);
                        $response->addJSON($res);
                    } else {
                        $response->addHTML(PMA_getHtmlForNormalizetable());
                    }
                }
            }
        }
    }
}
 /**
  * Test for PMA_getHtmlFor2NFstep1
  *
  * @return void
  */
 public function testPMAGetHtmlFor2NFstep1()
 {
     $db = "PMA_db";
     $table = "PMA_table";
     $result = PMA_getHtmlFor2NFstep1($db, $table);
     $this->assertInternalType('array', $result);
     $this->assertArrayHasKey('legendText', $result);
     $this->assertArrayHasKey('headText', $result);
     $this->assertArrayHasKey('subText', $result);
     $this->assertArrayHasKey('extra', $result);
     $this->assertArrayHasKey('primary_key', $result);
     $this->assertContains(__('Step 2.') . 1, $result['legendText']);
     $this->assertEquals('id', $result['primary_key']);
     $result1 = PMA_getHtmlFor2NFstep1($db, "PMA_table2");
     $this->assertEquals('id, col1', $result1['primary_key']);
     $this->assertTag(array('tag' => 'a', 'id' => 'showPossiblePd'), $result1['headText']);
     $this->assertTag(array('tag' => 'input', 'attributes' => array('value' => 'id', 'type' => 'checkbox')), $result1['extra']);
 }