diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e31c28ab..2e2b508a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -38,4 +38,4 @@ jobs: composer-options: --prefer-dist - name: Run Tests - run: vendor/bin/simple-phpunit + run: vendor/bin/phpunit diff --git a/.gitignore b/.gitignore index ead77b1f..f2a0dd24 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ # PHPUnit /build /phpunit.xml +.phpunit.cache .phpunit.result.cache # Documentation diff --git a/composer.json b/composer.json index 60fb498c..d0435529 100644 --- a/composer.json +++ b/composer.json @@ -20,18 +20,18 @@ "php": "^8.0", "ext-zip": "*", "ext-json": "*", - "symfony/asset": "^5.4 || ^6.0 || ^7.0", - "symfony/config": "^5.4 || ^6.0 || ^7.0", - "symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0", - "symfony/expression-language": "^5.4 || ^6.0 || ^7.0", - "symfony/form": "^5.4 || ^6.0 || ^7.0", - "symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0", - "symfony/http-foundation": "^5.4 || ^6.0 || ^7.0", - "symfony/http-kernel": "^5.4 || ^6.0 || ^7.0", - "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0", - "symfony/property-access": "^5.4 || ^6.0 || ^7.0", - "symfony/routing": "^5.4 || ^6.0 || ^7.0", - "symfony/twig-bundle": "^5.4 || ^6.0 || ^7.0", + "symfony/asset": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/config": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/expression-language": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/form": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/http-foundation": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/http-kernel": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/property-access": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/routing": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/twig-bundle": "^5.4 || ^6.0 || ^7.0 || ^8.0", "twig/twig": "^2.4 || ^3.0" }, "conflict": { @@ -40,11 +40,10 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.41", - "matthiasnoback/symfony-dependency-injection-test": "^4.0 || ^5.0", - "phpunit/phpunit": "^9.6", - "symfony/console": "^5.4 || ^6.0 || ^7.0", - "symfony/phpunit-bridge": "^5.4 || ^6.0 || ^7.0", - "symfony/yaml": "^5.4 || ^6.0 || ^7.0" + "matthiasnoback/symfony-dependency-injection-test": "^4.0 || ^5.0 || ^6.0", + "phpunit/phpunit": "^9.6 || ^10.5", + "symfony/console": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/yaml": "^5.4 || ^6.0 || ^7.0 || ^8.0" }, "suggest": { "egeloen/form-extra-bundle": "Allows to load CKEditor asynchronously" diff --git a/phpunit.xml.dist b/phpunit.xml.dist index ef9db803..039a5d22 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,36 +1,24 @@ - - - - - - ./tests - - - - - - installation - proxy - - - - - - ./ - - ./src/Resources - ./tests - ./vendor - - - - - - - + + + + ./tests + + + + + installation + proxy + + + + + ./ + + + ./src/Resources + ./tests + ./vendor + + diff --git a/tests/Builder/JsonBuilderTest.php b/tests/Builder/JsonBuilderTest.php index 59ba41c9..0e298965 100644 --- a/tests/Builder/JsonBuilderTest.php +++ b/tests/Builder/JsonBuilderTest.php @@ -106,7 +106,7 @@ public function testBuildWithValue(string $expected, array $values): void $this->assertSame($expected, $this->jsonBuilder->build()); } - public function valuesProvider(): array + public static function valuesProvider(): array { return [ // Arrays @@ -123,7 +123,7 @@ public function valuesProvider(): array ]; } - public function valueProvider(): array + public static function valueProvider(): array { return [ // Arrays diff --git a/tests/DependencyInjection/AbstractFOSCKEditorExtensionTest.php b/tests/DependencyInjection/AbstractTestFOSCKEditorExtension.php similarity index 99% rename from tests/DependencyInjection/AbstractFOSCKEditorExtensionTest.php rename to tests/DependencyInjection/AbstractTestFOSCKEditorExtension.php index f72e12fd..b33da192 100644 --- a/tests/DependencyInjection/AbstractFOSCKEditorExtensionTest.php +++ b/tests/DependencyInjection/AbstractTestFOSCKEditorExtension.php @@ -33,7 +33,7 @@ * @author GeLo * @author Adam Misiorny */ -abstract class AbstractFOSCKEditorExtensionTest extends TestCase +abstract class AbstractTestFOSCKEditorExtension extends TestCase { /** * @var ContainerBuilder diff --git a/tests/DependencyInjection/FOSCKEditorExtensionTest.php b/tests/DependencyInjection/FOSCKEditorExtensionTest.php index 0148ee0f..5da0ad53 100644 --- a/tests/DependencyInjection/FOSCKEditorExtensionTest.php +++ b/tests/DependencyInjection/FOSCKEditorExtensionTest.php @@ -34,8 +34,18 @@ public function testHasServiceDefinitionForTwigExtension(): void */ public function testIvoryDeprecation(): void { - $this->container->setParameter('kernel.bundles', ['IvoryCKEditorBundle' => '']); - $this->load(); + $initialErrorHandler = set_error_handler(static function (int $errno, string $errstr): void { + throw new \Exception($errstr, $errno); + }, E_USER_DEPRECATED); + + try { + self::expectExceptionMessage('IvoryCKEditorBundle isn\'t maintained anymore and should be replaced with FOSCKEditorBundle.'); + + $this->container->setParameter('kernel.bundles', ['IvoryCKEditorBundle' => '']); + $this->load(); + } finally { + set_error_handler($initialErrorHandler); + } } protected function getContainerExtensions(): array diff --git a/tests/DependencyInjection/YamlFOSCKEditorExtensionTest.php b/tests/DependencyInjection/YamlTestFOSCKEditorExtension.php similarity index 91% rename from tests/DependencyInjection/YamlFOSCKEditorExtensionTest.php rename to tests/DependencyInjection/YamlTestFOSCKEditorExtension.php index f7f9cff0..1b3f8cd0 100644 --- a/tests/DependencyInjection/YamlFOSCKEditorExtensionTest.php +++ b/tests/DependencyInjection/YamlTestFOSCKEditorExtension.php @@ -19,7 +19,7 @@ /** * @author GeLo */ -class YamlFOSCKEditorExtensionTest extends AbstractFOSCKEditorExtensionTest +class YamlTestFOSCKEditorExtension extends AbstractTestFOSCKEditorExtension { protected function loadConfiguration(ContainerBuilder $container, string $configuration): void { diff --git a/tests/Renderer/CKEditorRendererTest.php b/tests/Renderer/CKEditorRendererTest.php index 0203e09c..5a40a17f 100644 --- a/tests/Renderer/CKEditorRendererTest.php +++ b/tests/Renderer/CKEditorRendererTest.php @@ -433,7 +433,7 @@ public function testRenderTemplate(string $path, string $asset, string $url): vo ); } - public function languageProvider(): array + public static function languageProvider(): array { return [ ['en', 'en'], @@ -441,7 +441,7 @@ public function languageProvider(): array ]; } - public function directoryAssetProvider(): array + public static function directoryAssetProvider(): array { return [ ['directory/', 'url/', 'url/'], @@ -449,7 +449,7 @@ public function directoryAssetProvider(): array ]; } - public function fileAssetProvider(): array + public static function fileAssetProvider(): array { return [ ['file.js', 'url.js', 'url.js'], @@ -457,7 +457,7 @@ public function fileAssetProvider(): array ]; } - public function filesAssetProvider(): array + public static function filesAssetProvider(): array { return [ [['file'], ['url'], ['url']], @@ -469,7 +469,7 @@ public function filesAssetProvider(): array ]; } - public function filebrowserProvider(): array + public static function filebrowserProvider(): array { return [ ['Browse'], diff --git a/tests/Template/AbstractTemplateTest.php b/tests/Template/AbstractTestTemplate.php similarity index 99% rename from tests/Template/AbstractTemplateTest.php rename to tests/Template/AbstractTestTemplate.php index 7842e009..86b4bba1 100644 --- a/tests/Template/AbstractTemplateTest.php +++ b/tests/Template/AbstractTestTemplate.php @@ -29,7 +29,7 @@ * @author GeLo * @author Adam Misiorny */ -abstract class AbstractTemplateTest extends TestCase +abstract class AbstractTestTemplate extends TestCase { /** * @var CKEditorRenderer diff --git a/tests/Template/TwigTemplateTest.php b/tests/Template/TwigTestTemplate.php similarity index 92% rename from tests/Template/TwigTemplateTest.php rename to tests/Template/TwigTestTemplate.php index 94e87e5d..5e9e6e2d 100644 --- a/tests/Template/TwigTemplateTest.php +++ b/tests/Template/TwigTestTemplate.php @@ -15,11 +15,12 @@ use FOS\CKEditorBundle\Twig\CKEditorExtension; use Twig\Environment; use Twig\Loader\ArrayLoader; +use Twig\TemplateWrapper; /** * @author GeLo */ -class TwigTemplateTest extends AbstractTemplateTest +class TwigTestTemplate extends AbstractTestTemplate { /** * @var Environment @@ -27,7 +28,7 @@ class TwigTemplateTest extends AbstractTemplateTest private $twig; /** - * @var Template + * @var TemplateWrapper */ private $template;