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();
$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([]);
$this->_oModel = $modelMock;
@ -209,7 +209,7 @@ class ActionBaseTest extends d3ModCfgUnitTestCase
])
->getMock();
$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->atLeastOnce())->method('getFormElements')->willReturn($elements);
$this->_oModel = $modelMock;
@ -282,9 +282,9 @@ class ActionBaseTest extends d3ModCfgUnitTestCase
);
} catch (TaskException $e) {
if ($throwsException) {
$this->assertStringContainsString('ACTIONSELECT', $e->getMessage());
$this->assertStringContainsString('keine SELECTs exportieren', $e->getMessage());
} 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(
Registry::getLang()->translateString('D3_DATAWIZARD_DEBUG'),
'Debug: testMessage',
$this->callMethod(
$this->_oModel,
'getMessage'

View File

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

View File

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

View File

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