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

@ -14,9 +14,14 @@
testdox="true" testdox="true"
timeoutForSmallTests="1" timeoutForMediumTests="10" timeoutForLargeTests="60" timeoutForSmallTests="1" timeoutForMediumTests="10" timeoutForLargeTests="60"
verbose="true"> verbose="true">
<testsuites> <testsuites>
<testsuite name="tests"> <testsuite name="tests">
<directory>tests/</directory> <directory>tests/</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>
<coverage>
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>
</phpunit> </phpunit>

View File

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

View File

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

View File

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

View File

@ -9,6 +9,8 @@ use PHPUnit\Framework\TestCase;
/** /**
* This script contains tests for the uncertainty helper. * This script contains tests for the uncertainty helper.
*
* @covers \NodaUncertaintyHelper
*/ */
final class NodaUncertaintyHelperTest extends TestCase { 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. * This script contains tests for the validation of single field contents.
*
* @covers \NodaValidationHelper
*/ */
final class NodaValidationHelperTest extends TestCase { 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. * 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. * This script contains tests for the Wikidata fetcher.
*
* @covers \NodaWikidataFetcher
*/ */
final class NodaWikidataFetcherTest extends TestCase { final class NodaWikidataFetcherTest extends TestCase {
/** /**