56 lines
1.5 KiB
PHP
56 lines
1.5 KiB
PHP
<?PHP
|
|
/**
|
|
* Tests for plausi.
|
|
*
|
|
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
|
*/
|
|
declare(strict_types = 1);
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
require_once __DIR__ . '/../src/Checks/Plausi/MDPlausi.php';
|
|
require_once __DIR__ . '/../src/Checks/Plausi/MDEventCategory.php';
|
|
require_once __DIR__ . '/../src/Checks/Plausi/MDPlausiEventCategory.php';
|
|
require_once __DIR__ . '/../src/Checks/Plausi/MDPlausiEvent.php';
|
|
# require_once __DIR__ . '/../../MDTlLoader/src/MDTlLoader.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/MDEventsSet.php';
|
|
|
|
/** For mocking */
|
|
class MDTlLoader {
|
|
public function tl() {
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Tests for plausi.
|
|
*/
|
|
final class MDPlausiTest extends TestCase {
|
|
/**
|
|
* Ensures that a warning is returned, Checks the integration / evaluation function.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function testActorProducingObjectAfterOwnDeathResultsInWarning():void {
|
|
|
|
$tlLoader = $this->createMock(MDTlLoader::class);
|
|
$tlLoader->method('tl')->willReturn('foo');
|
|
|
|
$plausiEvent = new MDPlausiEvent(1,
|
|
"1912",
|
|
"1912",
|
|
"1912",
|
|
"Helmut Meyer",
|
|
"1859",
|
|
"1900");
|
|
|
|
$plausi = new MDPlausi($tlLoader, [$plausiEvent]);
|
|
$plausi->evaluate();
|
|
|
|
self::assertTrue($plausi->getWarningStatus());
|
|
|
|
|
|
}
|
|
}
|