Use real, not mocked, MDTlLoader in MDPlausiTest

This commit is contained in:
Joshua Ramon Enslin 2023-10-02 14:52:25 +02:00
parent 85597deefe
commit 641783f8a6
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE

View File

@ -8,6 +8,12 @@ declare(strict_types = 1);
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
define('TL_FILE_DIRS', [
__DIR__ . '/../../../l10n/musdb/',
__DIR__ . '/../../../l10n/quality-web/',
__DIR__ . '/../../importer/dependencies/MDAllowedValueSets/l18n/',
]);
require_once __DIR__ . '/../src/Checks/Plausi/MDPlausi.php'; require_once __DIR__ . '/../src/Checks/Plausi/MDPlausi.php';
require_once __DIR__ . '/../src/Checks/Plausi/MDEventCategory.php'; require_once __DIR__ . '/../src/Checks/Plausi/MDEventCategory.php';
require_once __DIR__ . '/../src/Checks/Plausi/MDPlausiEventCategory.php'; require_once __DIR__ . '/../src/Checks/Plausi/MDPlausiEventCategory.php';
@ -16,12 +22,7 @@ require_once __DIR__ . '/../src/Checks/Plausi/MDPlausiEvent.php';
require_once __DIR__ . '/../../importer/dependencies/MDAllowedValueSets/src/MDRequirementsSet.php'; require_once __DIR__ . '/../../importer/dependencies/MDAllowedValueSets/src/MDRequirementsSet.php';
require_once __DIR__ . '/../../importer/dependencies/MDAllowedValueSets/src/MDValueSet.php'; require_once __DIR__ . '/../../importer/dependencies/MDAllowedValueSets/src/MDValueSet.php';
require_once __DIR__ . '/../../importer/dependencies/MDAllowedValueSets/src/MDEventsSet.php'; require_once __DIR__ . '/../../importer/dependencies/MDAllowedValueSets/src/MDEventsSet.php';
require_once __DIR__ . '/../../importer/dependencies/MDTlLoader/src/MDTlLoader.php';
/** For mocking */
class MDTlLoader {
public function tl() {
}
}
/** /**
* Tests for plausi. * Tests for plausi.
@ -34,8 +35,7 @@ final class MDPlausiTest extends TestCase {
*/ */
public function testActorProducingObjectAfterOwnDeathResultsInWarning():void { public function testActorProducingObjectAfterOwnDeathResultsInWarning():void {
$tlLoader = $this->createMock(MDTlLoader::class); $tlLoader = new MDTlLoader("plausi_test", "en");
$tlLoader->method('tl')->willReturn('foo');
$plausiEvent = new MDPlausiEvent(1, $plausiEvent = new MDPlausiEvent(1,
"1912", "1912",