Add coverage information to tests, fix coverage of NodaValidationHelper

This commit is contained in:
Joshua Ramon Enslin 2023-11-07 23:31:42 +01:00
parent 1a7dbcd6f6
commit c9b0e7085f
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE
7 changed files with 37 additions and 5 deletions

View File

@ -19,4 +19,9 @@
<directory>tests/</directory>
</testsuite>
</testsuites>
<coverage>
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>
</phpunit>

View File

@ -9,6 +9,8 @@ use PHPUnit\Framework\TestCase;
/**
* This script contains tests for the actor name splitter.
*
* @covers \NodaNameSplitter
*/
final class NodaNameSplitterTest extends TestCase {
/**
@ -17,6 +19,7 @@ final class NodaNameSplitterTest extends TestCase {
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
* @group ValidOutput
* @small
* @covers \NodaNameSplitter::givenNameFamilyNameFromString
*
* @return void
*/

View File

@ -9,6 +9,8 @@ use PHPUnit\Framework\TestCase;
/**
* This script contains tests for the automatic translation class for time names.
*
* @covers \NodaTimeAutotranslater
*/
final class NodaTimeAutotranslaterTest extends TestCase {
/**

View File

@ -9,6 +9,8 @@ use PHPUnit\Framework\TestCase;
/**
* This script contains tests for the time name splitter.
*
* @covers \NodaTimeSplitter
*/
final class NodaTimeSplitterTest extends TestCase {
/**

View File

@ -9,6 +9,8 @@ use PHPUnit\Framework\TestCase;
/**
* This script contains tests for the uncertainty helper.
*
* @covers \NodaUncertaintyHelper
*/
final class NodaUncertaintyHelperTest extends TestCase {
/**

View File

@ -9,8 +9,24 @@ use PHPUnit\Framework\TestCase;
/**
* This script contains tests for the validation of single field contents.
*
* @covers \NodaValidationHelper
*/
final class NodaValidationHelperTest extends TestCase {
/**
* Test that a specific error is thrown if no description for actors is provided.
*
* @small
*
* @return void
*/
public function testActorDescriptionValidationFailsOnEmptyInput():void {
$this->expectException(MDInvalidEmptyInputException::class);
NodaValidationHelper::validateActorDescription("");
}
/**
* Test successfully refusing too short actor descriptions.
*

View File

@ -9,6 +9,8 @@ use PHPUnit\Framework\TestCase;
/**
* This script contains tests for the Wikidata fetcher.
*
* @covers \NodaWikidataFetcher
*/
final class NodaWikidataFetcherTest extends TestCase {
/**