Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eldarQa committed Feb 13, 2021
1 parent c1123a7 commit 2e1ae1f
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 58 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "^0.9.2",
"phpunit/phpunit": "^9.3.8",
"php-parallel-lint/php-parallel-lint": "v1.2.0",
"phpunit/phpunit": "^9.5.2",
"squizlabs/php_codesniffer": "^3.0"
},
"autoload": {
Expand Down
111 changes: 58 additions & 53 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/InlineKeyboardPagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,8 @@ protected function generateRange(): array
if ($this->forceButtonCount) {
$from = $this->selectedPage - floor($numberOfIntermediateButtons / 2);
$to = $this->selectedPage + ceil(
$numberOfIntermediateButtons / 2
) + ($this->selectedPage === 3 && $this->maxButtons > 5);
$numberOfIntermediateButtons / 2
) + ($this->selectedPage === 3 && $this->maxButtons > 5);
} else {
$from = $this->selectedPage - 1;
$to = $this->selectedPage + ($this->selectedPage === 3 ? $numberOfIntermediateButtons - 1 : 2);
Expand Down
3 changes: 1 addition & 2 deletions tests/InlineKeyboardPaginationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public function testInvalidConstructor()

$ikp = new InlineKeyboardPagination($this->items, $this->command, 10000, $this->itemsPerPage);
$ikp->getPagination();

}

public function testEmptyItemsConstructor()
Expand Down Expand Up @@ -229,7 +228,7 @@ public function testInvalidItemsPerPage()
$this->expectException(
\TelegramBot\InlineKeyboardPagination\Exceptions\InlineKeyboardPaginationException::class
);

$ikp = new InlineKeyboardPagination($this->items, $this->command, $this->selectedPage, 0);
$ikp->getPagination();
}
Expand Down

0 comments on commit 2e1ae1f

Please sign in to comment.