From 356d0f23215c5238d000f24a3749ade32954ba16 Mon Sep 17 00:00:00 2001 From: Karoly Gossler Date: Fri, 17 Feb 2023 00:31:29 +0100 Subject: [PATCH] add(test) enable phpunit tests --- .github/workflows/continuous-integration.yml | 5 +++- .gitignore | 3 +++ composer.json | 12 ++++++++- phpunit.xml.dist | 27 ++++++++++++++++++++ tests/bootstrap.php | 15 +++++++++++ 5 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 phpunit.xml.dist create mode 100644 tests/bootstrap.php diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 47e723aed..86a90b84b 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -59,5 +59,8 @@ jobs: - name: Run Check configuration run: php data/bin/check_configuration.php - - name: Run Tests + - name: Run Lime Tests run: php data/bin/symfony symfony:test --trace + + - name: Run PHPUnit Tests + run: php vendor/bin/phpunit diff --git a/.gitignore b/.gitignore index 3c17d4767..0644b20d6 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,6 @@ lib/plugins/sfDoctrinePlugin/test/functional/fixtures/log/ /vendor /composer.lock .php-cs-fixer.cache +.phpunit.result.cache +phpunit.xml +/tests/fixtures/symfony/log diff --git a/composer.json b/composer.json index a424d6ea6..c3664aab3 100755 --- a/composer.json +++ b/composer.json @@ -8,7 +8,9 @@ "swiftmailer/swiftmailer": "~5.2 || ^6.0" }, "require-dev": { - "psr/log": "*" + "psr/log": "*", + "phpunit/phpunit": "^9.6", + "symfony/phpunit-bridge": "^7.0" }, "autoload": { "files": ["autoload.php"] @@ -26,5 +28,13 @@ "replace": { "lexpress/symfony1": "^1.5" }, + "scripts": { + "test": [ + "@test:lime", + "@test:phpunit" + ], + "test:lime": "php data/bin/symfony symfony:test --trace", + "test:phpunit": "phpunit" + }, "bin": ["data/bin/symfony"] } diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 000000000..99dc45452 --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,27 @@ + + + + + + + + + + + + ./tests/ + + + + + + ./lib/ + + + diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 000000000..f362d1471 --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Bridge\PhpUnit\DeprecationErrorHandler; + +if ('disabled' !== getenv('SYMFONY_DEPRECATIONS_HELPER')) { + DeprecationErrorHandler::register(getenv('SYMFONY_DEPRECATIONS_HELPER')); +}