Skip to content

Commit e6982fb

Browse files
committed
migrate to phpunit 10.5
1 parent 26c6c88 commit e6982fb

File tree

9 files changed

+42
-47
lines changed

9 files changed

+42
-47
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"require-dev": {
4242
"friendsofphp/php-cs-fixer": "^3.41",
4343
"matthiasnoback/symfony-dependency-injection-test": "^4.0 || ^5.0 || ^6.0",
44-
"phpunit/phpunit": "^9.6",
44+
"phpunit/phpunit": "^9.6 || ^10.5",
4545
"symfony/console": "^5.4 || ^6.0 || ^7.0 || ^8.0",
4646
"symfony/phpunit-bridge": "^5.4 || ^6.0 || ^7.0 || ^8.0",
4747
"symfony/yaml": "^5.4 || ^6.0 || ^7.0 || ^8.0"

phpunit.xml.dist

Lines changed: 22 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,24 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
3-
<phpunit
4-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.0/phpunit.xsd"
6-
colors="true"
7-
bootstrap="tests/autoload.php">
8-
9-
<testsuites>
10-
<testsuite name="FOSCKEditorBundle Test Suite">
11-
<directory>./tests</directory>
12-
</testsuite>
13-
</testsuites>
14-
15-
<groups>
16-
<exclude>
17-
<group>installation</group>
18-
<group>proxy</group>
19-
</exclude>
20-
</groups>
21-
22-
<filter>
23-
<whitelist>
24-
<directory>./</directory>
25-
<exclude>
26-
<directory>./src/Resources</directory>
27-
<directory>./tests</directory>
28-
<directory>./vendor</directory>
29-
</exclude>
30-
</whitelist>
31-
</filter>
32-
33-
<listeners>
34-
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
35-
</listeners>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" colors="true" bootstrap="tests/autoload.php" cacheDirectory=".phpunit.cache">
3+
<testsuites>
4+
<testsuite name="FOSCKEditorBundle Test Suite">
5+
<directory>./tests</directory>
6+
</testsuite>
7+
</testsuites>
8+
<groups>
9+
<exclude>
10+
<group>installation</group>
11+
<group>proxy</group>
12+
</exclude>
13+
</groups>
14+
<source>
15+
<include>
16+
<directory>./</directory>
17+
</include>
18+
<exclude>
19+
<directory>./src/Resources</directory>
20+
<directory>./tests</directory>
21+
<directory>./vendor</directory>
22+
</exclude>
23+
</source>
3624
</phpunit>

tests/Builder/JsonBuilderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function testBuildWithValue(string $expected, array $values): void
106106
$this->assertSame($expected, $this->jsonBuilder->build());
107107
}
108108

109-
public function valuesProvider(): array
109+
public static function valuesProvider(): array
110110
{
111111
return [
112112
// Arrays
@@ -123,7 +123,7 @@ public function valuesProvider(): array
123123
];
124124
}
125125

126-
public function valueProvider(): array
126+
public static function valueProvider(): array
127127
{
128128
return [
129129
// Arrays

tests/DependencyInjection/AbstractFOSCKEditorExtensionTest.php renamed to tests/DependencyInjection/AbstractTestFOSCKEditorExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* @author GeLo <geloen.eric@gmail.com>
3434
* @author Adam Misiorny <adam.misiorny@gmail.com>
3535
*/
36-
abstract class AbstractFOSCKEditorExtensionTest extends TestCase
36+
abstract class AbstractTestFOSCKEditorExtension extends TestCase
3737
{
3838
/**
3939
* @var ContainerBuilder

tests/DependencyInjection/FOSCKEditorExtensionTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ public function testHasServiceDefinitionForTwigExtension(): void
3434
*/
3535
public function testIvoryDeprecation(): void
3636
{
37+
set_error_handler(static function (int $errno, string $errstr): void {
38+
throw new \Exception($errstr, $errno);
39+
}, E_USER_DEPRECATED);
40+
41+
self::expectExceptionMessage('IvoryCKEditorBundle isn\'t maintained anymore and should be replaced with FOSCKEditorBundle.');
42+
3743
$this->container->setParameter('kernel.bundles', ['IvoryCKEditorBundle' => '']);
3844
$this->load();
3945
}

tests/DependencyInjection/YamlFOSCKEditorExtensionTest.php renamed to tests/DependencyInjection/YamlTestFOSCKEditorExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/**
2020
* @author GeLo <geloen.eric@gmail.com>
2121
*/
22-
class YamlFOSCKEditorExtensionTest extends AbstractFOSCKEditorExtensionTest
22+
class YamlTestFOSCKEditorExtension extends AbstractTestFOSCKEditorExtension
2323
{
2424
protected function loadConfiguration(ContainerBuilder $container, string $configuration): void
2525
{

tests/Renderer/CKEditorRendererTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -433,31 +433,31 @@ public function testRenderTemplate(string $path, string $asset, string $url): vo
433433
);
434434
}
435435

436-
public function languageProvider(): array
436+
public static function languageProvider(): array
437437
{
438438
return [
439439
['en', 'en'],
440440
['pt_BR', 'pt-br'],
441441
];
442442
}
443443

444-
public function directoryAssetProvider(): array
444+
public static function directoryAssetProvider(): array
445445
{
446446
return [
447447
['directory/', 'url/', 'url/'],
448448
['directory/', 'url/?v=2', 'url/'],
449449
];
450450
}
451451

452-
public function fileAssetProvider(): array
452+
public static function fileAssetProvider(): array
453453
{
454454
return [
455455
['file.js', 'url.js', 'url.js'],
456456
['file.js', 'url.js?v=2', 'url.js?v=2'],
457457
];
458458
}
459459

460-
public function filesAssetProvider(): array
460+
public static function filesAssetProvider(): array
461461
{
462462
return [
463463
[['file'], ['url'], ['url']],
@@ -469,7 +469,7 @@ public function filesAssetProvider(): array
469469
];
470470
}
471471

472-
public function filebrowserProvider(): array
472+
public static function filebrowserProvider(): array
473473
{
474474
return [
475475
['Browse'],
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* @author GeLo <geloen.eric@gmail.com>
3030
* @author Adam Misiorny <adam.misiorny@gmail.com>
3131
*/
32-
abstract class AbstractTemplateTest extends TestCase
32+
abstract class AbstractTestTemplate extends TestCase
3333
{
3434
/**
3535
* @var CKEditorRenderer
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,20 @@
1515
use FOS\CKEditorBundle\Twig\CKEditorExtension;
1616
use Twig\Environment;
1717
use Twig\Loader\ArrayLoader;
18+
use Twig\TemplateWrapper;
1819

1920
/**
2021
* @author GeLo <geloen.eric@gmail.com>
2122
*/
22-
class TwigTemplateTest extends AbstractTemplateTest
23+
class TwigTestTemplate extends AbstractTestTemplate
2324
{
2425
/**
2526
* @var Environment
2627
*/
2728
private $twig;
2829

2930
/**
30-
* @var Template
31+
* @var TemplateWrapper
3132
*/
3233
private $template;
3334

0 commit comments

Comments
 (0)