]> Raphaël G. Git Repositories - airlibre/commitdiff
Recipe phpunit/phpunit update master
authorRaphaël Gertz <git@rapsys.eu>
Thu, 26 Nov 2026 18:01:29 +0000 (19:01 +0100)
committerRaphaël Gertz <git@rapsys.eu>
Thu, 26 Nov 2026 18:01:29 +0000 (19:01 +0100)
.env.test [new file with mode: 0644]
.gitignore
bin/phpunit [new file with mode: 0644]
phpunit.dist.xml [new file with mode: 0644]
tests/bootstrap.php [new file with mode: 0644]

diff --git a/.env.test b/.env.test
new file mode 100644 (file)
index 0000000..64bd111
--- /dev/null
+++ b/.env.test
@@ -0,0 +1,3 @@
+# define your env variables for the test env here
+KERNEL_CLASS='App\Kernel'
+APP_SECRET='$ecretf0rt3st'
index 08a13c3223a02c2735fe9957c6c60b913380e0bd..4828442ecfefc7ae8584f117a9a0679b8868c210 100644 (file)
@@ -11,7 +11,7 @@
 ###< symfony/framework-bundle ###
 ###> phpunit/phpunit ###
 /phpunit.xml
-.phpunit.result.cache
+/.phpunit.cache/
 ###< phpunit/phpunit ###
 
 ###> rapsys/airbundle ###
diff --git a/bin/phpunit b/bin/phpunit
new file mode 100644 (file)
index 0000000..ac5eef1
--- /dev/null
@@ -0,0 +1,4 @@
+#!/usr/bin/env php
+<?php
+
+require dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit';
diff --git a/phpunit.dist.xml b/phpunit.dist.xml
new file mode 100644 (file)
index 0000000..22bd879
--- /dev/null
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
+<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
+         colors="true"
+         failOnDeprecation="true"
+         failOnNotice="true"
+         failOnWarning="true"
+         bootstrap="tests/bootstrap.php"
+         cacheDirectory=".phpunit.cache"
+>
+    <php>
+        <ini name="display_errors" value="1" />
+        <ini name="error_reporting" value="-1" />
+        <server name="APP_ENV" value="test" force="true" />
+        <server name="SHELL_VERBOSITY" value="-1" />
+    </php>
+
+    <testsuites>
+        <testsuite name="Project Test Suite">
+            <directory>tests</directory>
+        </testsuite>
+    </testsuites>
+
+    <source ignoreSuppressionOfDeprecations="true"
+            ignoreIndirectDeprecations="true"
+            restrictNotices="true"
+            restrictWarnings="true"
+    >
+        <include>
+            <directory>src</directory>
+        </include>
+
+        <deprecationTrigger>
+            <method>Doctrine\Deprecations\Deprecation::trigger</method>
+            <method>Doctrine\Deprecations\Deprecation::delegateTriggerToBackend</method>
+            <function>trigger_deprecation</function>
+        </deprecationTrigger>
+    </source>
+
+    <extensions>
+    </extensions>
+</phpunit>
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
new file mode 100644 (file)
index 0000000..43ba851
--- /dev/null
@@ -0,0 +1,13 @@
+<?php
+
+use Symfony\Component\Dotenv\Dotenv;
+
+require dirname(__DIR__).'/vendor/autoload.php';
+
+if (method_exists(Dotenv::class, 'bootEnv')) {
+    (new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
+}
+
+if ($_SERVER['APP_DEBUG']) {
+    umask(0022);
+}