Skip to content

Commit

Permalink
Test for _getOffsets function in PMA_DisplayResults class
Browse files Browse the repository at this point in the history
  • Loading branch information
Chanaka committed Jul 2, 2012
1 parent fcd2189 commit 56d641e
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/classes/PMA_DisplayResults_test.php
Expand Up @@ -750,5 +750,30 @@ public function testGetCheckBoxesForMultipleRowOperations(
);
}

/**
* Test for _getOffsets - case 1
*/
public function testGetOffsetsCase1()
{
$_SESSION['tmp_user_values']['max_rows'] = PMA_DisplayResults::ALL_ROWS;
$this->assertEquals(
$this->_callPrivateFunction('_getOffsets', array()),
array(0, 0)
);
}

/**
* Test for _getOffsets - case 2
*/
public function testGetOffsetsCase2()
{
$_SESSION['tmp_user_values']['max_rows'] = 5;
$_SESSION['tmp_user_values']['pos'] = 4;
$this->assertEquals(
$this->_callPrivateFunction('_getOffsets', array()),
array(9, 0)
);
}


}

0 comments on commit 56d641e

Please sign in to comment.