Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ jobs:
composer-options: --prefer-dist

- name: Run Tests
run: vendor/bin/simple-phpunit
run: vendor/bin/phpunit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# PHPUnit
/build
/phpunit.xml
.phpunit.cache
.phpunit.result.cache

# Documentation
Expand Down
33 changes: 16 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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"
Expand Down
56 changes: 22 additions & 34 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,36 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.0/phpunit.xsd"
colors="true"
bootstrap="tests/autoload.php">

<testsuites>
<testsuite name="FOSCKEditorBundle Test Suite">
<directory>./tests</directory>
</testsuite>
</testsuites>

<groups>
<exclude>
<group>installation</group>
<group>proxy</group>
</exclude>
</groups>

<filter>
<whitelist>
<directory>./</directory>
<exclude>
<directory>./src/Resources</directory>
<directory>./tests</directory>
<directory>./vendor</directory>
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>
<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">
<testsuites>
<testsuite name="FOSCKEditorBundle Test Suite">
<directory>./tests</directory>
</testsuite>
</testsuites>
<groups>
<exclude>
<group>installation</group>
<group>proxy</group>
</exclude>
</groups>
<source>
<include>
<directory>./</directory>
</include>
<exclude>
<directory>./src/Resources</directory>
<directory>./tests</directory>
<directory>./vendor</directory>
</exclude>
</source>
</phpunit>
4 changes: 2 additions & 2 deletions tests/Builder/JsonBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -123,7 +123,7 @@ public function valuesProvider(): array
];
}

public function valueProvider(): array
public static function valueProvider(): array
{
return [
// Arrays
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* @author GeLo <geloen.eric@gmail.com>
* @author Adam Misiorny <adam.misiorny@gmail.com>
*/
abstract class AbstractFOSCKEditorExtensionTest extends TestCase
abstract class AbstractTestFOSCKEditorExtension extends TestCase
{
/**
* @var ContainerBuilder
Expand Down
14 changes: 12 additions & 2 deletions tests/DependencyInjection/FOSCKEditorExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* @author GeLo <geloen.eric@gmail.com>
*/
class YamlFOSCKEditorExtensionTest extends AbstractFOSCKEditorExtensionTest
class YamlTestFOSCKEditorExtension extends AbstractTestFOSCKEditorExtension
{
protected function loadConfiguration(ContainerBuilder $container, string $configuration): void
{
Expand Down
10 changes: 5 additions & 5 deletions tests/Renderer/CKEditorRendererTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,31 +433,31 @@ public function testRenderTemplate(string $path, string $asset, string $url): vo
);
}

public function languageProvider(): array
public static function languageProvider(): array
{
return [
['en', 'en'],
['pt_BR', 'pt-br'],
];
}

public function directoryAssetProvider(): array
public static function directoryAssetProvider(): array
{
return [
['directory/', 'url/', 'url/'],
['directory/', 'url/?v=2', 'url/'],
];
}

public function fileAssetProvider(): array
public static function fileAssetProvider(): array
{
return [
['file.js', 'url.js', 'url.js'],
['file.js', 'url.js?v=2', 'url.js?v=2'],
];
}

public function filesAssetProvider(): array
public static function filesAssetProvider(): array
{
return [
[['file'], ['url'], ['url']],
Expand All @@ -469,7 +469,7 @@ public function filesAssetProvider(): array
];
}

public function filebrowserProvider(): array
public static function filebrowserProvider(): array
{
return [
['Browse'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* @author GeLo <geloen.eric@gmail.com>
* @author Adam Misiorny <adam.misiorny@gmail.com>
*/
abstract class AbstractTemplateTest extends TestCase
abstract class AbstractTestTemplate extends TestCase
{
/**
* @var CKEditorRenderer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,20 @@
use FOS\CKEditorBundle\Twig\CKEditorExtension;
use Twig\Environment;
use Twig\Loader\ArrayLoader;
use Twig\TemplateWrapper;

/**
* @author GeLo <geloen.eric@gmail.com>
*/
class TwigTemplateTest extends AbstractTemplateTest
class TwigTestTemplate extends AbstractTestTemplate
{
/**
* @var Environment
*/
private $twig;

/**
* @var Template
* @var TemplateWrapper
*/
private $template;

Expand Down