Skip to content

Commit 68f86ce

Browse files
author
Jean-François Lépine
committed
trying to fix depreciations
1 parent d404ff5 commit 68f86ce

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

src/Toolkit/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
"symfony/finder": "6.4|^7.0",
4444
"tales-from-a-dev/twig-tailwind-extra": "^0.3.0",
4545
"zenstruck/console-test": "^1.7",
46-
"symfony/http-client": "6.4|^7.0"
46+
"symfony/http-client": "6.4|^7.0",
47+
"symfony/stopwatch": "^7.2"
4748
},
4849
"autoload": {
4950
"psr-4": {

src/Toolkit/phpunit.xml.dist

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@
1111
<ini name="error_reporting" value="-1"/>
1212
<server name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&amp;max[direct]=0"/>
1313
<server name="KERNEL_CLASS" value="Symfony\UX\Toolkit\Tests\Fixtures\Kernel"/>
14+
<ini name="error_reporting" value="-1" />
15+
<server name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0&amp;max[direct]=0"/>
1416
</php>
1517
<testsuites>
1618
<testsuite name="UX Toolkit Test Suite">
1719
<directory>tests</directory>
1820
</testsuite>
1921
</testsuites>
22+
<listeners>
23+
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
24+
</listeners>
2025
</phpunit>

src/Toolkit/tests/ComponentRepository/RepositoryFactoryTest.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\UX\Toolkit\Tests\ComponentRepository;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
1516
use Symfony\UX\Toolkit\ComponentRepository\GithubRepository;
1617
use Symfony\UX\Toolkit\ComponentRepository\OfficialRepository;
1718
use Symfony\UX\Toolkit\ComponentRepository\RepositoryFactory;
@@ -21,7 +22,7 @@
2122
/**
2223
* @author Jean-François Lépine
2324
*/
24-
class RepositoryFactoryTest extends TestCase
25+
class RepositoryFactoryTest extends KernelTestCase
2526
{
2627
/**
2728
* @dataProvider providesSources
@@ -31,10 +32,8 @@ public function testItShouldFactoryRepositoryAccordingToItsName(
3132
?string $expectedInstance,
3233
bool $shouldThrowException = false,
3334
): void {
34-
$factory = new RepositoryFactory(
35-
$this->createMock(OfficialRepository::class),
36-
$this->createMock(GithubRepository::class)
37-
);
35+
$this->bootKernel();
36+
$factory = static::getContainer()->get(RepositoryFactory::class);
3837

3938
if ($shouldThrowException) {
4039
$this->expectException(\InvalidArgumentException::class);

0 commit comments

Comments
 (0)