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

feat: allow PHPUnit 11 (WIP) #175

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
5 changes: 2 additions & 3 deletions Tests/Twig/Extension/CurrencyExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Locale;
use Money\Currency;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Tbbc\MoneyBundle\Formatter\MoneyFormatter;
use Tbbc\MoneyBundle\Twig\Extension\CurrencyExtension;
Expand All @@ -30,9 +31,7 @@ public function testName(): void
self::assertSame('tbbc_money_currency_extension', $this->extension->getName());
}

/**
* @dataProvider getCurrencyTests
*/
#[DataProvider('getCurrencyTests')]
public function testCurrency($template, $expected): void
{
$this->assertSame($expected, $this->getTemplate($template)->render($this->variables));
Expand Down
5 changes: 2 additions & 3 deletions Tests/Twig/Extension/MoneyExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Locale;
use Money\Currency;
use Money\Money;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Tbbc\MoneyBundle\Formatter\MoneyFormatter;
Expand Down Expand Up @@ -52,9 +53,7 @@ public function testName(): void
self::assertSame('tbbc_money_extension', $this->extension->getName());
}

/**
* @dataProvider getMoneyTests
*/
#[DataProvider('getMoneyTests')]
public function testMoney($template, $expected): void
{
$this->assertSame($expected, $this->getTemplate($template)->render($this->variables));
Expand Down
7 changes: 7 additions & 0 deletions Tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
declare(strict_types=1);

use Symfony\Component\ErrorHandler\ErrorHandler;

# PHPUnit 11 needs this, otherwise there is an error 'Test code or tested code did not remove its own exception handlers'
ErrorHandler::register(null, false);
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
"florianv/exchanger": "^2.8.1",
"php-http/message": "^1.0",
"php-http/guzzle7-adapter": "^1.0",
"vimeo/psalm": "^5.20",
"symfony/phpunit-bridge": "^5.4|^6.0|^7.0",
"phpunit/phpunit": "^10.5.9",
"vimeo/psalm": "^5.20 || 6.x-dev as 6.0.0",
"symfony/phpunit-bridge": "^7.0",
"phpunit/phpunit": "^10.5.9|^11.0.3",
"symfony/yaml": "^5.4|^6.0|^7.0",
"http-interop/http-factory-guzzle": "^1.2"
},
Expand Down
Loading