Skip to content

A free, self-hostable news aggregator…

Move PHPUnit flags to a config file and use strictest failure mode (#9374)

Inverle05bfbb9f33b2
diff --git a/composer.json b/composer.json
index 219fb2dc3..82210cf8c 100644
--- a/composer.json
+++ b/composer.json
@@ -71,7 +71,7 @@
"phpcbf": "phpcbf . -p -s",
"phpstan": "phpstan analyse --memory-limit 512M .",
"phpstan-next": "phpstan analyse --memory-limit 512M -c phpstan-next.neon .",
- "phpunit": "phpunit --bootstrap ./tests/bootstrap.php --display-notices --display-deprecations --display-phpunit-deprecations ./tests",
+ "phpunit": "phpunit",
"compile-plurals": "php cli/compile.plurals.php --all",
"translations": "cli/manipulate.translation.php --action format && php cli/compile.plurals.php --all && cli/check.translation.php --generate-readme",
"test": [
diff --git a/lib/Minz/Session.php b/lib/Minz/Session.php
index c8875e19e..8498e1c12 100644
--- a/lib/Minz/Session.php
+++ b/lib/Minz/Session.php
@@ -223,7 +223,7 @@ class Minz_Session {
}
// Ensure that regenerating the session won't send multiple cookies so we can send one ourselves instead
ini_set('session.use_cookies', '0');
- if (session_name($name) === false || !session_start()) {
+ if (session_name($name) === false || !@session_start()) {
throw new RuntimeException("Session {$name} could not be started!");
}
if (!session_regenerate_id(delete_old_session: true)) {
diff --git a/phpunit.xml b/phpunit.xml
new file mode 100644
index 000000000..33ba741db
--- /dev/null
+++ b/phpunit.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<phpunit
+ bootstrap="./tests/bootstrap.php"
+ displayDetailsOnAllIssues="true"
+ failOnAllIssues="true"
+>
+ <testsuites>
+ <testsuite name="default">
+ <directory>./tests</directory>
+ </testsuite>
+ </testsuites>
+</phpunit>