Compare commits
No commits in common. "ff49f1f319dfb92f97079eb1ba96ca2ac0538de4" and "75f2538e16092dfff968cc7c76c22788df6d48a7" have entirely different histories.
ff49f1f319
...
75f2538e16
24
README.md
24
README.md
|
@ -2,26 +2,4 @@
|
|||
|
||||
This directory contains concordance lists for accepted values. Where e.g. an entry type may be identified at museum-digital only by its ID, it is not realistic to expect providers of import data (which is to say: museums) to enter the entry type ID from museum-digital's relevant list. Hence, the lists contained in this subdirectory provide human-readable names for the IDs accepted by museum-digital as found in previous imports, so that they can be automatically translated to the IDs and names as used within the context of museum-digital.
|
||||
|
||||
The lists are grouped as (private) class constants of their relevant entry type.
|
||||
|
||||
- All class names may be prefixed with _MDConc_.
|
||||
- All concordance list classes implement the MDImporterConcordanceListInterface interface.
|
||||
- They can thus all be used using a static function `getConcordanceTarget(string $input)`. E.g.:
|
||||
```
|
||||
$checkType = MDConcCheckTypes::getConcordanceTarget("Vollständigkeit");
|
||||
```
|
||||
- All concordance lists can be found directly in the `[/src](./src)` directory.
|
||||
|
||||
## Environment and Purpose for Using a Separate Subrepository
|
||||
|
||||
This repository is intended to be used as a subrepository of MDImporter. Its full functionality is thus only available with the inclusion of some other subrepositories provided in the context of the importer (e.g. MDAllowedValueSets).
|
||||
|
||||
Editing can be done by simply adding to the lists however. It is hoped, that the publication of this subrepository as a standalone repository makes this process easier. Just clone this repository and enter the missing values in the relevant classes in the `[/src](./src)` directory.
|
||||
|
||||
## Testing
|
||||
|
||||
Tests exist to ensure that all concordance lists implement the MDImporterConcordanceListInterface interface and throw an MDImporterMissingConcordance exception, if a new, yet unknown value is encountered. If this repository is set up as part of an installation of the MDImporter, they can be run using:
|
||||
|
||||
```
|
||||
phpunit tests
|
||||
```
|
||||
The lists are grouped as class constants of their relevant entry type. All class names may be prefixed with _MDConc_.
|
||||
|
|
|
@ -41,6 +41,11 @@ final class InterfaceImplementationTest extends TestCase {
|
|||
/**
|
||||
* Test all concordance lists for their implementation of MDImporterConcordanceListInterface.
|
||||
*
|
||||
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||
* @group ValidOutput
|
||||
* @group HTMLOutput
|
||||
* @group SafeForProduction
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testListInterfaceIsImplemented():void {
|
||||
|
@ -56,19 +61,4 @@ final class InterfaceImplementationTest extends TestCase {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure all tests throw the MDImporterMissingConcordance exception, if
|
||||
* a new value is encountered.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testMDImporterMissingConcordanceIsThrownForNewValues():void {
|
||||
|
||||
foreach ($this->_lists as $list) {
|
||||
$this->expectException(MDImporterMissingConcordance::class);
|
||||
(new $list)::getConcordanceTarget("ThisInputShouldNotExist");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user