Inheritance: extends PMA\libraries\controllers\DatabaseController
コード例 #1
0
 /**
  * Tests for handleRealRowCountRequestAction()
  *
  * @return void
  * @test
  */
 public function testHandleRealRowCountRequestAction()
 {
     $_REQUEST['table'] = 'table';
     $ctrl = new DatabaseStructureController(null, null, null, null, null, null, null);
     $ctrl->handleRealRowCountRequestAction();
     $json = $this->_response->getJSONResult();
     $this->assertEquals(6, $json['real_row_count']);
     // Fall into another branch
     $_REQUEST['real_row_count_all'] = 'abc';
     $GLOBALS['tables'] = array(array('TABLE_NAME' => 'table'));
     $ctrl->handleRealRowCountRequestAction();
     $json = $this->_response->getJSONResult();
     $expected_result = array(array('table' => 'table', 'row_count' => 6));
     $this->assertEquals(json_encode($expected_result), $json['real_row_count_all']);
 }
コード例 #2
0
 /**
  * Tests for handleRealRowCountRequestAction()
  *
  * @return void
  * @test
  */
 public function testHandleRealRowCountRequestAction()
 {
     $_REQUEST['table'] = 'table';
     $ctrl = new DatabaseStructureController($GLOBALS['db'], null);
     // Showing statistics
     $class = new ReflectionClass('PMA\\libraries\\controllers\\database\\DatabaseStructureController');
     $property = $class->getProperty('_tables');
     $property->setAccessible(true);
     $ctrl->handleRealRowCountRequestAction();
     $json = $this->_response->getJSONResult();
     $this->assertEquals(6, $json['real_row_count']);
     // Fall into another branch
     $_REQUEST['real_row_count_all'] = 'abc';
     $property->setValue($ctrl, array(array('TABLE_NAME' => 'table')));
     $ctrl->handleRealRowCountRequestAction();
     $json = $this->_response->getJSONResult();
     $expected_result = array(array('table' => 'table', 'row_count' => 6));
     $this->assertEquals(json_encode($expected_result), $json['real_row_count_all']);
 }