Przeglądaj źródła

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

See:
* https://docs.phpunit.de/en/12.5/xml-configuration-file.html#the-failonallissues-attribute
* https://docs.phpunit.de/en/12.5/xml-configuration-file.html#the-displaydetailsonallissues-attribute
Inverle 16 godzin temu
rodzic
commit
05bfbb9f33
3 zmienionych plików z 14 dodań i 2 usunięć
  1. 1 1
      composer.json
  2. 1 1
      lib/Minz/Session.php
  3. 12 0
      phpunit.xml

+ 1 - 1
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": [

+ 1 - 1
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)) {

+ 12 - 0
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>