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:
parent
f4488addc7
commit
8e8b7df450
@ -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"';
|
||||
|
||||
@ -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)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user