From 36ee1a5957a250c27b0cf8f9a8a54e61953019f5 Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Fri, 10 May 2024 14:22:32 +0200 Subject: [PATCH] fix tests --- phpunit.xml | 36 +++++++++++++++++++ tests/phpunit.xml | 27 -------------- .../Model/Exceptions/DebugExceptionTest.php | 2 +- .../Model/ExportRenderer/CsvTest.php | 11 +++--- 4 files changed, 41 insertions(+), 35 deletions(-) create mode 100644 phpunit.xml delete mode 100644 tests/phpunit.xml diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..f651f58 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,36 @@ + + + + + tests/unit + + + + + Application + + + ../.php-cs-fixer.php + ../IntelliSenseHelper.php + + + + + + diff --git a/tests/phpunit.xml b/tests/phpunit.xml deleted file mode 100644 index 6c09de6..0000000 --- a/tests/phpunit.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - ../Application - ../Modules - ../public - ../Setup - - - - - - diff --git a/tests/unit/Application/Model/Exceptions/DebugExceptionTest.php b/tests/unit/Application/Model/Exceptions/DebugExceptionTest.php index 73e5bc5..2d273ee 100644 --- a/tests/unit/Application/Model/Exceptions/DebugExceptionTest.php +++ b/tests/unit/Application/Model/Exceptions/DebugExceptionTest.php @@ -51,7 +51,7 @@ class DebugExceptionTest extends d3ModCfgUnitTestCase ); $this->assertStringContainsString( - 'DEBUG', + 'Debug', $this->callMethod( $this->_oModel, 'getMessage' diff --git a/tests/unit/Application/Model/ExportRenderer/CsvTest.php b/tests/unit/Application/Model/ExportRenderer/CsvTest.php index a4a058f..b3a509d 100644 --- a/tests/unit/Application/Model/ExportRenderer/CsvTest.php +++ b/tests/unit/Application/Model/ExportRenderer/CsvTest.php @@ -122,13 +122,10 @@ class CsvTest extends ExportRendererTest ->getMock(); $configMock->expects($this->atLeastOnce())->method('getConfigParam')->willReturnCallback( function ($argName) { - switch ($argName) { - case 'sGiCsvFieldEncloser': - case 'sCSVSign': - return false; - default: - return Registry::getConfig()->getConfigParam($argName); - } + return match ( $argName ) { + 'sGiCsvFieldEncloser', 'sCSVSign' => null, + default => Registry::getConfig()->getConfigParam( $argName ), + }; } );