Add test for cases of actors dying about 95 years ago (between Berne
convention expiry and max. expiry) and fix early variable access
This commit is contained in:
@ -47,6 +47,29 @@ final class MDPlausiForLegalStatusTest extends TestCase {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that no warning is present if no information has been provided.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testNoWarningForObjectWithActorsDeceased95YearsAgo():void {
|
||||
|
||||
$plausiEvent = new MDPlausiEvent(1,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"Somebody",
|
||||
date("Y", strtotime("-95 years")),
|
||||
date("Y", strtotime("-95 years")));
|
||||
|
||||
$plausiLegal = new MDPlausiForLegalStatus([$plausiEvent], [['name' => 'test.jpg', 'license' => 'RR-F']]);
|
||||
$warningStatus = $plausiLegal->evaluateSimple();
|
||||
|
||||
self::assertFalse($warningStatus['has_warning']);
|
||||
self::assertEmpty($warningStatus['msgs']);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that a warning is returned, if the object's representations are published under
|
||||
* restrictive licenses Checks the integration / evaluation function.
|
||||
@ -105,6 +128,31 @@ final class MDPlausiForLegalStatusTest extends TestCase {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that a warning is returned, if the object's representations are published under
|
||||
* restrictive licenses Checks the integration / evaluation function.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testPublicDomainObjectExpectsPdForActorsWithNoDeathDateBornInMedievalTimes():void {
|
||||
|
||||
$plausiEvent = new MDPlausiEvent(1,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"Helmut Meyer23",
|
||||
"1400",
|
||||
"");
|
||||
|
||||
$plausiLegal = new MDPlausiForLegalStatus([$plausiEvent], [['name' => 'test23.jpg', 'license' => 'RR-F']]);
|
||||
$warningStatus = $plausiLegal->evaluateSimple();
|
||||
|
||||
self::assertTrue($warningStatus['has_warning']);
|
||||
self::assertNotEmpty($warningStatus['msgs']);
|
||||
self::assertEquals(MDPlausiLegalCheckResultType::expect_public_domain, $warningStatus['msgs'][0]['type']);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that a warning is returned if the author / creator died only in the current year.
|
||||
*
|
||||
@ -129,6 +177,30 @@ final class MDPlausiForLegalStatusTest extends TestCase {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that a warning is returned if the author / creator died only in the current year.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testCreatorBornWithinLast100YearsAsksForRestrictedLicense():void {
|
||||
|
||||
$plausiEvent = new MDPlausiEvent(1,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"Helmut Meyer",
|
||||
"1922",
|
||||
"");
|
||||
|
||||
$plausiLegal = new MDPlausiForLegalStatus([$plausiEvent], [['name' => 'test.jpg', 'license' => 'Public Domain Mark']]);
|
||||
$warningStatus = $plausiLegal->evaluateSimple();
|
||||
|
||||
self::assertTrue($warningStatus['has_warning']);
|
||||
self::assertNotEmpty($warningStatus['msgs']);
|
||||
self::assertEquals(MDPlausiLegalCheckResultType::expect_restricted_legal_status, $warningStatus['msgs'][0]['type']);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that a warning is returned if the creator is still alive.
|
||||
*
|
||||
|
Reference in New Issue
Block a user