Skip to content

Commit

Permalink
add(test) enable phpunit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
connorhu committed Feb 16, 2024
1 parent 55a02ab commit bbcc676
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 11 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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"]
}
27 changes: 27 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" ?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
colors="true"
bootstrap="tests/bootstrap.php"
failOnRisky="true"
failOnWarning="true"
stderr="true">
<php>
<ini name="error_reporting" value="32767" />
<ini name="intl.default_locale" value="en" />
<ini name="intl.error_level" value="0" />
<ini name="memory_limit" value="-1" />
</php>

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

<coverage>
<include>
<directory>./lib/</directory>
</include>
</coverage>
</phpunit>
15 changes: 15 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

/*
* This file is part of the symfony package.
* (c) Fabien Potencier <fabien@symfony.com>
*
* 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'));
}

0 comments on commit bbcc676

Please sign in to comment.