Skip to content

Commit bbcc676

Browse files
committed
add(test) enable phpunit tests
1 parent 55a02ab commit bbcc676

File tree

5 files changed

+60
-2
lines changed

5 files changed

+60
-2
lines changed

.github/workflows/continuous-integration.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,8 @@ jobs:
5959
- name: Run Check configuration
6060
run: php data/bin/check_configuration.php
6161

62-
- name: Run Tests
62+
- name: Run Lime Tests
6363
run: php data/bin/symfony symfony:test --trace
64+
65+
- name: Run PHPUnit Tests
66+
run: php vendor/bin/phpunit

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ lib/plugins/sfDoctrinePlugin/test/functional/fixtures/log/
77
/vendor
88
/composer.lock
99
.php-cs-fixer.cache
10+
.phpunit.result.cache
11+
phpunit.xml
12+
/tests/fixtures/symfony/log

composer.json

+11-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
"swiftmailer/swiftmailer": "~5.2 || ^6.0"
99
},
1010
"require-dev": {
11-
"psr/log": "*"
11+
"psr/log": "*",
12+
"phpunit/phpunit": "^9.6",
13+
"symfony/phpunit-bridge": "^7.0"
1214
},
1315
"autoload": {
1416
"files": ["autoload.php"]
@@ -26,5 +28,13 @@
2628
"replace": {
2729
"lexpress/symfony1": "^1.5"
2830
},
31+
"scripts": {
32+
"test": [
33+
"@test:lime",
34+
"@test:phpunit"
35+
],
36+
"test:lime": "php data/bin/symfony symfony:test --trace",
37+
"test:phpunit": "phpunit"
38+
},
2939
"bin": ["data/bin/symfony"]
3040
}

phpunit.xml.dist

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+
colors="true"
5+
bootstrap="tests/bootstrap.php"
6+
failOnRisky="true"
7+
failOnWarning="true"
8+
stderr="true">
9+
<php>
10+
<ini name="error_reporting" value="32767" />
11+
<ini name="intl.default_locale" value="en" />
12+
<ini name="intl.error_level" value="0" />
13+
<ini name="memory_limit" value="-1" />
14+
</php>
15+
16+
<testsuites>
17+
<testsuite name="Symfony Test Suite">
18+
<directory>./tests/</directory>
19+
</testsuite>
20+
</testsuites>
21+
22+
<coverage>
23+
<include>
24+
<directory>./lib/</directory>
25+
</include>
26+
</coverage>
27+
</phpunit>

tests/bootstrap.php

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the symfony package.
5+
* (c) Fabien Potencier <[email protected]>
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
11+
use Symfony\Bridge\PhpUnit\DeprecationErrorHandler;
12+
13+
if ('disabled' !== getenv('SYMFONY_DEPRECATIONS_HELPER')) {
14+
DeprecationErrorHandler::register(getenv('SYMFONY_DEPRECATIONS_HELPER'));
15+
}

0 commit comments

Comments
 (0)