Add array for ISO639-2b language codes
This commit is contained in:
38
tests/MDLanguagesSetTest.php
Normal file
38
tests/MDLanguagesSetTest.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?PHP
|
||||
/**
|
||||
* This script contains tests for the home page.
|
||||
*
|
||||
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||
*/
|
||||
declare(strict_types = 1);
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
require __DIR__ . '/../src/MDLanguagesSet.php';
|
||||
|
||||
/**
|
||||
* Tests for home page.
|
||||
*/
|
||||
final class MDLanguagesSetTest extends TestCase {
|
||||
/**
|
||||
* Test to check whether the HTML page is correctly generated.
|
||||
*
|
||||
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||
* @group ValidOutput
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testIso639ListIsCorrect():void {
|
||||
|
||||
foreach (MDLanguagesSet::AVAILABLE_LANGUAGES as $language_code => $language_name) {
|
||||
|
||||
self::assertArrayHasKey($language_code, MDLanguagesSet::LANGUAGES_ISO639_2B, 'Language ' . $language_code . ' (' . $language_name . ') has no entry in ISO639-2b language code list');
|
||||
self::assertEquals(3, strlen(MDLanguagesSet::LANGUAGES_ISO639_2B[$language_code]), 'ISO639-2b entry for language ' . $language_code . ' (' . $language_name . ') is not = 3');
|
||||
|
||||
}
|
||||
|
||||
foreach (MDLanguagesSet::LANGUAGES_ISO639_2B as $language_code => $language_name) {
|
||||
self::assertArrayHasKey($language_code, MDLanguagesSet::AVAILABLE_LANGUAGES, 'Language ' . $language_code . ' (' . $language_name . ') has an entry in ISO639-2b language code list, but not in the main list.');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
40
tests/config.xml
Normal file
40
tests/config.xml
Normal file
@@ -0,0 +1,40 @@
|
||||
<phpunit
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/|version|/phpunit.xsd"
|
||||
backupGlobals="false"
|
||||
backupStaticAttributes="false"
|
||||
beStrictAboutChangesToGlobalState="false"
|
||||
beStrictAboutOutputDuringTests="false"
|
||||
beStrictAboutResourceUsageDuringSmallTests="true"
|
||||
beStrictAboutTodoAnnotatedTests="true"
|
||||
beStrictAboutCoversAnnotation="false"
|
||||
cacheResult="false"
|
||||
colors="true"
|
||||
convertErrorsToExceptions="true"
|
||||
convertDeprecationsToExceptions="true"
|
||||
convertNoticesToExceptions="true"
|
||||
convertWarningsToExceptions="true"
|
||||
enforceTimeLimit="true"
|
||||
failOnWarning="true"
|
||||
forceCoversAnnotation="false"
|
||||
printerClass="Codedungeon\PHPUnitPrettyResultPrinter\Printer"
|
||||
processIsolation="true"
|
||||
stopOnError="true"
|
||||
stopOnFailure="true"
|
||||
stopOnIncomplete="true"
|
||||
stopOnSkipped="true"
|
||||
stopOnRisky="true"
|
||||
testSuiteLoaderClass="PHPUnit\Runner\StandardTestSuiteLoader"
|
||||
timeoutForSmallTests="1"
|
||||
timeoutForMediumTests="10"
|
||||
timeoutForLargeTests="60"
|
||||
verbose="true">
|
||||
<!-- <file>/path/to/file</file>
|
||||
<exclude>
|
||||
<directory suffix=".php">/path/to/files</directory>
|
||||
<file>/path/to/file</file>
|
||||
preserveGlobalState="false"
|
||||
runTestInSeparateProcess="true"
|
||||
</exclude>-->
|
||||
</phpunit>
|
||||
|
Reference in New Issue
Block a user