Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Add Unit Test

Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Fix Lint

Signed-off-by: Saksham Gupta <shucon01@gmail.com>

Add comment

Signed-off-by: Saksham Gupta <shucon01@gmail.com>
This commit is contained in:
Saksham Gupta 2021-01-27 15:38:41 +05:30
parent f4488addc7
commit 8e8b7df450
2 changed files with 10 additions and 0 deletions

View File

@ -1297,6 +1297,10 @@ class Util
$pages = array_unique($pages);
}
if ($pageNow > $nbTotalPage) {
$pages[] = $pageNow;
}
foreach ($pages as $i) {
if ($i == $pageNow) {
$selected = 'selected="selected" style="font-weight: bold"';

View File

@ -372,6 +372,12 @@ class UtilTest extends AbstractTestCase
'<select class="pageselector ajax" name="pma" >',
Util::pageselector('pma', 3)
);
// If pageNow > nbTotalPage, show the pageNow number to avoid confusion
$this->assertStringContainsString(
'<option selected="selected" style="font-weight: bold" value="297">100</option>',
Util::pageselector('pma', 3, 100, 50)
);
}
/**