adjust tests

This commit is contained in:
Daniel Seifert 2024-05-13 15:33:46 +02:00
parent be873efb32
commit 76fd879554
5 changed files with 8 additions and 8 deletions

View File

@ -180,7 +180,7 @@ class ActionBaseTest extends d3ModCfgUnitTestCase
]) ])
->getMock(); ->getMock();
$modelMock->expects($this->atLeastOnce())->method('hasFormElements')->willReturn(false); $modelMock->expects($this->atLeastOnce())->method('hasFormElements')->willReturn(false);
$modelMock->expects($this->atLeastOnce())->method('executeAction')->willReturn(1); $modelMock->expects($this->atLeastOnce())->method('executeAction');
$modelMock->expects($this->atLeastOnce())->method('getQuery')->willReturn([]); $modelMock->expects($this->atLeastOnce())->method('getQuery')->willReturn([]);
$this->_oModel = $modelMock; $this->_oModel = $modelMock;
@ -209,7 +209,7 @@ class ActionBaseTest extends d3ModCfgUnitTestCase
]) ])
->getMock(); ->getMock();
$modelMock->expects($this->atLeastOnce())->method('hasFormElements')->willReturn(true); $modelMock->expects($this->atLeastOnce())->method('hasFormElements')->willReturn(true);
$modelMock->expects($this->exactly((int) !$blThrowException))->method('executeAction')->willReturn(1); $modelMock->expects($this->exactly((int) !$blThrowException))->method('executeAction');
$modelMock->expects($this->exactly((int) !$blThrowException))->method('getQuery')->willReturn([]); $modelMock->expects($this->exactly((int) !$blThrowException))->method('getQuery')->willReturn([]);
$modelMock->expects($this->atLeastOnce())->method('getFormElements')->willReturn($elements); $modelMock->expects($this->atLeastOnce())->method('getFormElements')->willReturn($elements);
$this->_oModel = $modelMock; $this->_oModel = $modelMock;
@ -282,9 +282,9 @@ class ActionBaseTest extends d3ModCfgUnitTestCase
); );
} catch (TaskException $e) { } catch (TaskException $e) {
if ($throwsException) { if ($throwsException) {
$this->assertStringContainsString('ACTIONSELECT', $e->getMessage()); $this->assertStringContainsString('keine SELECTs exportieren', $e->getMessage());
} else { } else {
$this->assertStringContainsString('ACTIONRESULT', $e->getMessage()); $this->assertStringContainsString('1 Eintrag verändert', $e->getMessage());
} }
} }
} }

View File

@ -52,7 +52,7 @@ class DebugExceptionTest extends d3ModCfgUnitTestCase
); );
$this->assertStringContainsString( $this->assertStringContainsString(
Registry::getLang()->translateString('D3_DATAWIZARD_DEBUG'), 'Debug: testMessage',
$this->callMethod( $this->callMethod(
$this->_oModel, $this->_oModel,
'getMessage' 'getMessage'

View File

@ -52,7 +52,7 @@ class ExportFileExceptionTest extends d3ModCfgUnitTestCase
); );
$this->assertStringContainsString( $this->assertStringContainsString(
Registry::getLang()->translateString('D3_DATAWIZARD_ERR_EXPORTFILEERROR'), 'kann nicht angelegt werden',
$this->callMethod( $this->callMethod(
$this->_oModel, $this->_oModel,
'getMessage' 'getMessage'

View File

@ -52,7 +52,7 @@ class NoSuitableRendererExceptionTest extends d3ModCfgUnitTestCase
); );
$this->assertStringContainsString( $this->assertStringContainsString(
Registry::getLang()->translateString('D3_DATAWIZARD_ERR_NOSUITABLERENDERER'), 'kein Renderer f',
$this->callMethod( $this->callMethod(
$this->_oModel, $this->_oModel,
'getMessage' 'getMessage'

View File

@ -592,7 +592,7 @@ class ExportBaseTest extends d3ModCfgUnitTestCase
); );
} catch (TaskException $e) { } catch (TaskException $e) {
if ($throwsException) { if ($throwsException) {
$this->assertStringContainsString('NOEXPORTSELECT', $e->getMessage()); $this->assertStringContainsString('Export kann nicht ausgeführt werden', $e->getMessage());
} elseif (!count($dbResult)) { } elseif (!count($dbResult)) {
$this->assertStringContainsString('kein Inhalt', $e->getMessage()); $this->assertStringContainsString('kein Inhalt', $e->getMessage());
} }