Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PHPUnit (9 --> 10) #800

Merged
merged 3 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
'@Symfony' => true,
'@Symfony:risky' => true,
'@PHP80Migration:risky' => true,
'@PHPUnit84Migration:risky' => true,
'@PHP81Migration' => true,
'@PHPUnit100Migration:risky' => true,
'ordered_imports' => true,
'declare_strict_types' => false,
'native_function_invocation' => ['include' => ['@all']],
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"require-dev": {
"phpstan/phpstan": "^1.11",
"phpunit/phpunit": "^9.6",
"phpunit/phpunit": "^10.5 || ^11.3",
"symfony/expression-language": "^6.4 || ^7.0",
"symfony/templating": "^6.4 || ^7.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/KnpPaginatorExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;

final class KnpPaginatorExtension extends Extension
{
Expand Down
13 changes: 5 additions & 8 deletions tests/Pagination/SlidingPaginationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Knp\Bundle\PaginatorBundle\Tests\Pagination;

use Knp\Bundle\PaginatorBundle\Pagination\SlidingPagination;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

/**
Expand All @@ -19,9 +20,7 @@ protected function setUp(): void
$this->pagination = new SlidingPagination([]);
}

/**
* @dataProvider getPageLimitData
*/
#[DataProvider('getPageLimitData')]
public function testGetPageCount(int $expected, int $totalItemCount, int $itemsPerPage, ?int $pageLimit): void
{
$this->pagination->setTotalItemCount($totalItemCount);
Expand All @@ -31,9 +30,7 @@ public function testGetPageCount(int $expected, int $totalItemCount, int $itemsP
$this->assertSame($expected, $this->pagination->getPageCount());
}

/**
* @dataProvider getSortedData
*/
#[DataProvider('getSortedData')]
public function testSorted(bool $expected, string $sort, string $direction, $key): void
{
$this->pagination->setPaginatorOptions([
Expand All @@ -46,7 +43,7 @@ public function testSorted(bool $expected, string $sort, string $direction, $key
$this->assertSame($expected, $this->pagination->isSorted($key));
}

public function getPageLimitData(): array
public static function getPageLimitData(): array
{
return [
'Normal' => [5, 120, 25, null],
Expand All @@ -56,7 +53,7 @@ public function getPageLimitData(): array
];
}

public function getSortedData(): \Generator
public static function getSortedData(): \Generator
{
yield [true, 'title', 'asc', null];
yield [true, 'title', 'asc', 'title'];
Expand Down