Fix: Ob buffer cleanup on exception

# Fix: Ob buffer cleanup on exception

The OB buffer capture was incorrectly cleaned up on exception.
This fixes that.

Also modified the SecurityTest to enable running it standalone
This commit is contained in:
MDW
2024-03-10 15:17:58 +01:00
parent 4c442de1a2
commit 101d56a2c1
3 changed files with 19 additions and 3 deletions

View File

@@ -26,11 +26,16 @@
* \remarks Class that extends all PHPunit tests. To share similare code between each test.
*/
// Workaround for false security issue with main.inc.php in tests:
$_SERVER['PHP_SELF'] = "phpunit";
global $conf,$user,$langs,$db;
//define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver
//require_once 'PHPUnit/Autoload.php';
require_once dirname(__FILE__).'/../../htdocs/master.inc.php';
if (empty($user->id)) {
print "Load permissions for admin user nb 1\n";
$user->fetch(1);