Skip to content

Commit

Permalink
Add phpUnit for CircleCI config file, do note rely on .dist file anym…
Browse files Browse the repository at this point in the history
…ore.
  • Loading branch information
SebastienTouze committed Apr 3, 2020
1 parent c8d6838 commit c7cd571
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
key: node-v1-{{ checksum "yarn.lock" }}
paths:
- node_modules
- run: cp assets/js/template.params.json assets/js/params.json && yarn dev

# running tests
- run: php vendor/bin/simple-phpunit tests/
- run: php -d memory_limit=512M vendor/bin/simple-phpunit --configuration .circleci/phpunit.xml tests/Functional
38 changes: 38 additions & 0 deletions .circleci/phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="../tests/bootstrap.php"
>
<php>
<ini name="error_reporting" value="-1"/>
<env name="APP_ENV" value="test"/>
<env name="SHELL_VERBOSITY" value="-1"/>
<env name="SYMFONY_PHPUNIT_VERSION" value="8.5"/>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled=1"/>
</php>

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

<filter>
<whitelist>
<directory>src</directory>
<exclude>
<directory>src/DataFixtures</directory>
<directory>src/Migrations</directory>
<file>src/Kernel.php</file>
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
</listeners>
</phpunit>
16 changes: 11 additions & 5 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="config/bootstrap.php"
bootstrap="tests/bootstrap.php"
>
<php>
<ini name="error_reporting" value="-1" />
<env name="APP_ENV" value="test" />
<env name="SHELL_VERBOSITY" value="-1" />
<ini name="error_reporting" value="-1"/>
<env name="APP_ENV" value="test"/>
<env name="SHELL_VERBOSITY" value="-1"/>
<env name="SYMFONY_PHPUNIT_VERSION" value="8.5"/>
</php>

<testsuites>
Expand All @@ -22,10 +23,15 @@
<filter>
<whitelist>
<directory>src</directory>
<exclude>
<directory>src/DataFixtures</directory>
<directory>src/Migrations</directory>
<file>src/Kernel.php</file>
</exclude>
</whitelist>
</filter>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
</listeners>
</phpunit>

0 comments on commit c7cd571

Please sign in to comment.