From f8b79867aaa5aead2df0b77c911bf0e727bb8c65 Mon Sep 17 00:00:00 2001 From: mshroom <32199029+mshroom@users.noreply.github.com> Date: Wed, 3 Jun 2026 15:11:24 +0300 Subject: [PATCH 1/6] Add tests to LIDO-EDM transformation --- .../Base/Utils/XslTransformationTest.php | 128 ++ .../transformations/europeana-license.xsl | 47 + .../transformations/lido2edm.xsl | 1145 +++++++++++++++++ .../transformations/lido2edm_3D.properties | 30 + .../transformations/lido2edm_image.properties | 30 + .../transformations/lido2edm_text.properties | 30 + .../transformations/lido2edm_video.properties | 30 + .../transformations/url-encode.xsl | 48 + .../transformations/validate-lang.xsl | 40 + .../transformations/validate-text-lang.xsl | 52 + .../transformations/wikidata-worktype.xsl | 272 ++++ .../Base/utils/XslTransformation/lido_3D.xml | 261 ++++ .../utils/XslTransformation/lido_3D_edm.xml | 69 + .../utils/XslTransformation/lido_image.xml | 222 ++++ .../XslTransformation/lido_image_edm.xml | 47 + .../utils/XslTransformation/lido_text.xml | 208 +++ .../utils/XslTransformation/lido_text_edm.xml | 48 + .../utils/XslTransformation/lido_video.xml | 256 ++++ .../XslTransformation/lido_video_edm.xml | 61 + 19 files changed, 3024 insertions(+) create mode 100644 tests/RecordManagerTest/Base/Utils/XslTransformationTest.php create mode 100644 tests/fixtures/Base/config/xsltransformationtest/transformations/europeana-license.xsl create mode 100644 tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl create mode 100644 tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_3D.properties create mode 100644 tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_image.properties create mode 100644 tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_text.properties create mode 100644 tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_video.properties create mode 100644 tests/fixtures/Base/config/xsltransformationtest/transformations/url-encode.xsl create mode 100644 tests/fixtures/Base/config/xsltransformationtest/transformations/validate-lang.xsl create mode 100644 tests/fixtures/Base/config/xsltransformationtest/transformations/validate-text-lang.xsl create mode 100644 tests/fixtures/Base/config/xsltransformationtest/transformations/wikidata-worktype.xsl create mode 100644 tests/fixtures/Base/utils/XslTransformation/lido_3D.xml create mode 100644 tests/fixtures/Base/utils/XslTransformation/lido_3D_edm.xml create mode 100644 tests/fixtures/Base/utils/XslTransformation/lido_image.xml create mode 100644 tests/fixtures/Base/utils/XslTransformation/lido_image_edm.xml create mode 100644 tests/fixtures/Base/utils/XslTransformation/lido_text.xml create mode 100644 tests/fixtures/Base/utils/XslTransformation/lido_text_edm.xml create mode 100644 tests/fixtures/Base/utils/XslTransformation/lido_video.xml create mode 100644 tests/fixtures/Base/utils/XslTransformation/lido_video_edm.xml diff --git a/tests/RecordManagerTest/Base/Utils/XslTransformationTest.php b/tests/RecordManagerTest/Base/Utils/XslTransformationTest.php new file mode 100644 index 000000000..021fdefcc --- /dev/null +++ b/tests/RecordManagerTest/Base/Utils/XslTransformationTest.php @@ -0,0 +1,128 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://github.com/NatLibFi/RecordManager + */ + +namespace RecordManagerTest\Base\Utils; + +use RecordManager\Base\Utils\XslTransformation; +use RecordManagerTest\Base\Feature\FixtureTrait; + +/** + * XmlTransformation tests + * + * @category DataManagement + * @package RecordManager + * @author Minna Rönkä + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://github.com/NatLibFi/RecordManager + */ +class XslTransformationTest extends \PHPUnit\Framework\TestCase +{ + use FixtureTrait; + + /** + * Test LIDO-EDM transformation with image + * + * @return void + */ + public function testLido2EdmTransformationWithImage() + { + $xslTransformation = $this->getXslTransformation("lido2edm_image.properties"); + $lidoRecord = $this->getFixture('utils/XslTransformation/lido_image.xml'); + $expectedEdm = $this->getFixture('utils/XslTransformation/lido_image_edm.xml'); + $transformedEdm = $xslTransformation->transform($lidoRecord); + $this->assertSame($expectedEdm, $transformedEdm); + } + + /** + * Test LIDO-EDM transformation with video + * + * @return void + */ + public function testLido2EdmTransformationWithVideo() + { + $xslTransformation = $this->getXslTransformation("lido2edm_video.properties"); + $lidoRecord = $this->getFixture('utils/XslTransformation/lido_video.xml'); + $expectedEdm = $this->getFixture('utils/XslTransformation/lido_video_edm.xml'); + $transformedEdm = $xslTransformation->transform($lidoRecord); + $this->assertSame($expectedEdm, $transformedEdm); + } + + /** + * Test LIDO-EDM transformation with text + * + * @return void + */ + public function testLido2EdmTransformationWithText() + { + $xslTransformation = $this->getXslTransformation("lido2edm_text.properties"); + $lidoRecord = $this->getFixture('utils/XslTransformation/lido_text.xml'); + $expectedEdm = $this->getFixture('utils/XslTransformation/lido_text_edm.xml'); + $transformedEdm = $xslTransformation->transform($lidoRecord); + $this->assertSame($expectedEdm, $transformedEdm); + } + + /** + * Test LIDO-EDM transformation with 3D + * + * @return void + */ + public function testLido2EdmTransformationWith3D() + { + $xslTransformation = $this->getXslTransformation("lido2edm_3D.properties"); + $lidoRecord = $this->getFixture('utils/XslTransformation/lido_3D.xml'); + $expectedEdm = $this->getFixture('utils/XslTransformation/lido_3D_edm.xml'); + $transformedEdm = $xslTransformation->transform($lidoRecord); + $this->assertSame($expectedEdm, $transformedEdm); + } + + /** + * Create XmlTransformation + * + * @param string $config Transformation config file name + * + * @return XslTransformation + */ + protected function getXslTransformation(string $config) + { + return new XslTransformation( + $this->getConfigDir(), + $config + ); + } + + /** + * Get config directory + * + * @return string + */ + protected function getConfigDir() + { + return $this->getFixtureDir() . 'config/xsltransformationtest/transformations'; + } +} diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/europeana-license.xsl b/tests/fixtures/Base/config/xsltransformationtest/transformations/europeana-license.xsl new file mode 100644 index 000000000..4918e2a1b --- /dev/null +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/europeana-license.xsl @@ -0,0 +1,47 @@ + + + + + + + + + + + + http://creativecommons.org/licenses/ + + + + / + + / + + + + + http://creativecommons.org/publicdomain/mark/1.0/ + + + + + http://creativecommons.org/publicdomain/zero/1.0/ + + + + + http://rightsstatements.org/vocab/InC/1.0/ + + + + + http://rightsstatements.org/vocab/CNE/1.0/ + + + + + + + + + diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl new file mode 100644 index 000000000..84a70e338 --- /dev/null +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl @@ -0,0 +1,1145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 3D + + + VIDEO + + + SOUND + + + IMAGE + + + TEXT + + + IMAGE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_3D.properties b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_3D.properties new file mode 100644 index 000000000..a1f330da1 --- /dev/null +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_3D.properties @@ -0,0 +1,30 @@ +; XSLT Export Settings for EDM format +[General] +; REQUIRED: Name of XSLT file to apply. Path is relative to the transformations directory +; of the RecordManager installation. +xslt = lido2edm.xsl +; OPTIONAL: PHP function(s) to register for use within XSLT file. You may repeat +; this line to register multiple PHP functions. +php_function[] = str_replace +php_function[] = rawurlencode +php_function[] = mb_strtolower +; OPTIONAL: PHP class filled with public static functions for use by the XSLT file. +; The class name must match the filename, and the file must exist in the transformations +; directory of the RecordManager installation. You may repeat this line to load multiple +; custom classes. +;custom_class[] = +;custom_class[] = + +; XSLT parameters -- any key/value pairs set here will be passed as parameters to +; the XSLT file, allowing local values to be set without modifying XSLT code. +[Parameters] +; Finna datasource name +museum = "testmuseum" +; Name of the aggregator +provider = "National Library of Finland" +; Name of the museum +data_provider = "Test Museum" +; Default content type if more specific type is missing +default_type = "Museum object" +; URL to the preferred Finna view +sourceURL = "http://testmuseum.finna.fi" diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_image.properties b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_image.properties new file mode 100644 index 000000000..a1f330da1 --- /dev/null +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_image.properties @@ -0,0 +1,30 @@ +; XSLT Export Settings for EDM format +[General] +; REQUIRED: Name of XSLT file to apply. Path is relative to the transformations directory +; of the RecordManager installation. +xslt = lido2edm.xsl +; OPTIONAL: PHP function(s) to register for use within XSLT file. You may repeat +; this line to register multiple PHP functions. +php_function[] = str_replace +php_function[] = rawurlencode +php_function[] = mb_strtolower +; OPTIONAL: PHP class filled with public static functions for use by the XSLT file. +; The class name must match the filename, and the file must exist in the transformations +; directory of the RecordManager installation. You may repeat this line to load multiple +; custom classes. +;custom_class[] = +;custom_class[] = + +; XSLT parameters -- any key/value pairs set here will be passed as parameters to +; the XSLT file, allowing local values to be set without modifying XSLT code. +[Parameters] +; Finna datasource name +museum = "testmuseum" +; Name of the aggregator +provider = "National Library of Finland" +; Name of the museum +data_provider = "Test Museum" +; Default content type if more specific type is missing +default_type = "Museum object" +; URL to the preferred Finna view +sourceURL = "http://testmuseum.finna.fi" diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_text.properties b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_text.properties new file mode 100644 index 000000000..a1f330da1 --- /dev/null +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_text.properties @@ -0,0 +1,30 @@ +; XSLT Export Settings for EDM format +[General] +; REQUIRED: Name of XSLT file to apply. Path is relative to the transformations directory +; of the RecordManager installation. +xslt = lido2edm.xsl +; OPTIONAL: PHP function(s) to register for use within XSLT file. You may repeat +; this line to register multiple PHP functions. +php_function[] = str_replace +php_function[] = rawurlencode +php_function[] = mb_strtolower +; OPTIONAL: PHP class filled with public static functions for use by the XSLT file. +; The class name must match the filename, and the file must exist in the transformations +; directory of the RecordManager installation. You may repeat this line to load multiple +; custom classes. +;custom_class[] = +;custom_class[] = + +; XSLT parameters -- any key/value pairs set here will be passed as parameters to +; the XSLT file, allowing local values to be set without modifying XSLT code. +[Parameters] +; Finna datasource name +museum = "testmuseum" +; Name of the aggregator +provider = "National Library of Finland" +; Name of the museum +data_provider = "Test Museum" +; Default content type if more specific type is missing +default_type = "Museum object" +; URL to the preferred Finna view +sourceURL = "http://testmuseum.finna.fi" diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_video.properties b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_video.properties new file mode 100644 index 000000000..fb22eb251 --- /dev/null +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_video.properties @@ -0,0 +1,30 @@ +; XSLT Export Settings for EDM format +[General] +; REQUIRED: Name of XSLT file to apply. Path is relative to the transformations directory +; of the RecordManager installation. +xslt = lido2edm.xsl +; OPTIONAL: PHP function(s) to register for use within XSLT file. You may repeat +; this line to register multiple PHP functions. +php_function[] = str_replace +php_function[] = rawurlencode +php_function[] = mb_strtolower +; OPTIONAL: PHP class filled with public static functions for use by the XSLT file. +; The class name must match the filename, and the file must exist in the transformations +; directory of the RecordManager installation. You may repeat this line to load multiple +; custom classes. +;custom_class[] = +;custom_class[] = + +; XSLT parameters -- any key/value pairs set here will be passed as parameters to +; the XSLT file, allowing local values to be set without modifying XSLT code. +[Parameters] +; Finna datasource name +museum = "testmuseum" +; Name of the aggregator +provider = "National Library of Finland" +; Name of the museum +data_provider = "Test Museum" +; Default content type if more specific type is missing +default_type = "Museum object" +; URL to the preferred Finna view +sourceURL = "objectWebResource" diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/url-encode.xsl b/tests/fixtures/Base/config/xsltransformationtest/transformations/url-encode.xsl new file mode 100644 index 000000000..589ebaed9 --- /dev/null +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/url-encode.xsl @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/validate-lang.xsl b/tests/fixtures/Base/config/xsltransformationtest/transformations/validate-lang.xsl new file mode 100644 index 000000000..09bc60449 --- /dev/null +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/validate-lang.xsl @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/validate-text-lang.xsl b/tests/fixtures/Base/config/xsltransformationtest/transformations/validate-text-lang.xsl new file mode 100644 index 000000000..a373121ef --- /dev/null +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/validate-text-lang.xsl @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/wikidata-worktype.xsl b/tests/fixtures/Base/config/xsltransformationtest/transformations/wikidata-worktype.xsl new file mode 100644 index 000000000..a50a5adc4 --- /dev/null +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/wikidata-worktype.xsl @@ -0,0 +1,272 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/fixtures/Base/utils/XslTransformation/lido_3D.xml b/tests/fixtures/Base/utils/XslTransformation/lido_3D.xml new file mode 100644 index 000000000..1c15e765b --- /dev/null +++ b/tests/fixtures/Base/utils/XslTransformation/lido_3D.xml @@ -0,0 +1,261 @@ + + + + testimuseo-K1554 + + + + + malli + + + + + Fotogrammetrinen malli + + + 100 valokuva + + + 12345 + + + fin + + + + + + + Kissa nurmikolla -3D-malli + + + + + + + Testimuseo + + + K1554 + + + + + mustavalkoinen kissa nukkuu nurmikolla + black and white cat sleeping on grass + + + + + 6 x 6 cm + 6 x 6 cm + + + + + + + + valmistus + Creation + + + + + + Karvinen, Osku + + + + kuvaaja + + + + + valmistusaika 2009 + + + kuvauspaikka Kissakuja 1, Helsinki + + + fotogrammetria + + + negatiivi + + + negatiivi + negative + + + + + Photographing was done while the cat was sleeping because the cat refused to co-operate + + + + + + + näyttely + + + Kissat kautta aikojen - Helsinki Cat Exhibition + + + 1.11.2022–31.2.2023 + + + + + + + + + + Yleinen suomalainen asiasanasto + kissat + + + http://www.yso.fi/onto/yso/p16142 + nurmikot + + + + + + + http://iconclass.org/48C5 + maalaustaide, piirrostaide ja taidegrafiikka + + + + + + + + + Hänen Majesteettinsa Kissa Kissanen + + + + + aiheen paikka Kissakujan nurmikko + + + + + + + + Kissakuvakokoelma + Cat image collection + + + Kokoelma + + + + + + + + K1554 + + item + + + + Testimuseo + + + + + CC0 + julkinen + + + + + + K1554_1 + K1554_1.jpg + + https://kissarepo/images/download?id=k1554_1&size=thumb + + + https://kissarepo/images/download?id=k1554_1&size=large + + + https://kissarepo/images/download?id=k1554_1&size=master + + + + CC BY 4.0 + Tiedostoa voi käyttää vapaasti myös kaupallisesti. + + + + + K1554_2 + K1554_2.jpg + + https://kissarepo/images/download?id=k1554_2&size=thumb + + + https://kissarepo/images/download?id=k1554_2&size=large + + + https://kissarepo/images/download?id=k1554_2&size=original + + + + CC BY 4.0 + Tiedostoa voi käyttää vapaasti myös kaupallisesti. + + + + + K1554_3 + Avaa Sketchfabissa + + https://kissarepo/images/download?id=k1554_3&size=original&format=glb + + koko + size + verteksit + vertices + 60000 + + + koko + size + polygonit + polygons + 21069 + + + + https://sketchfab.com/3d-models/k1554_3 + + + 3D Mesh + + + + CC BY 4.0 + Tiedostoa voi käyttää vapaasti myös kaupallisesti. + + + + Testimuseo + + + Testimuseo / Karvinen, Osku + + + + + + diff --git a/tests/fixtures/Base/utils/XslTransformation/lido_3D_edm.xml b/tests/fixtures/Base/utils/XslTransformation/lido_3D_edm.xml new file mode 100644 index 000000000..96b9e5637 --- /dev/null +++ b/tests/fixtures/Base/utils/XslTransformation/lido_3D_edm.xml @@ -0,0 +1,69 @@ + + + + Karvinen, Osku + mustavalkoinen kissa nukkuu nurmikolla + black and white cat sleeping on grass + Photographing was done while the cat was sleeping because the cat refused to co-operate + fotogrammetria + K1554 + fin + kissat + + + Hänen Majesteettinsa Kissa Kissanen + Kissa nurmikolla -3D-malli + + Fotogrammetrinen malli + 100 valokuva + valmistusaika 2009 + 6 x 6 cm + 6 x 6 cm + Kissakuvakokoelma + Cat image collection + Kissat kautta aikojen - Helsinki Cat Exhibition + negatiivi + kuvauspaikka Kissakuja 1, Helsinki + aiheen paikka Kissakujan nurmikko + 1.11.2022–31.2.2023 + 3D + + + + + + + + + Testimuseo / Karvinen, Osku + Testimuseo + + + + + + Testimuseo / Karvinen, Osku + Testimuseo + + + 21069 + + 60000 + + + + Test Museum + + + + + + + National Library of Finland + + + + + Sketchfab + + diff --git a/tests/fixtures/Base/utils/XslTransformation/lido_image.xml b/tests/fixtures/Base/utils/XslTransformation/lido_image.xml new file mode 100644 index 000000000..679156d10 --- /dev/null +++ b/tests/fixtures/Base/utils/XslTransformation/lido_image.xml @@ -0,0 +1,222 @@ + + + + testimuseo-K1554 + + + + + valokuva + + + + + valokuvanegatiivi + + + 100 valokuva + + + 12345 + + + fin + + + + + + + Kissa nurmikolla + + + + + + + Testimuseo + + + K1554 + + + + + mustavalkoinen kissa nukkuu nurmikolla + black and white cat sleeping on grass + + + + + 6 x 6 cm + 6 x 6 cm + + + + + + + + valmistus + Creation + + + + + + Karvinen, Osku + + + + kuvaaja + + + + + valmistusaika 2009 + + + kuvauspaikka Kissakuja 1, Helsinki + + + salakuvaus + + + negatiivi + + + negatiivi + negative + + + + + Photographing was done while the cat was sleeping because the cat refused to co-operate + + + + + + + näyttely + + + Kissat kautta aikojen - Helsinki Cat Exhibition + + + 1.11.2022–31.2.2023 + + + + + + + + + + Yleinen suomalainen asiasanasto + kissat + + + http://www.yso.fi/onto/yso/p16142 + nurmikot + + + + + + + http://iconclass.org/48C5 + maalaustaide, piirrostaide ja taidegrafiikka + + + + + + + + + Hänen Majesteettinsa Kissa Kissanen + + + + + aiheen paikka Kissakujan nurmikko + + + + + + + + Kissakuvakokoelma + Cat image collection + + + Kokoelma + + + + + + + + K1554 + + item + + + + Testimuseo + + + + + CC0 + julkinen + + + + + + K1554_1 + K1554_1.jpg + + https://kissarepo/images/download?id=k1554_1&size=thumb + + + https://kissarepo/images/download?id=k1554_1&size=large + + + https://kissarepo/images/download?id=k1554_1&size=master + + + + CC BY 4.0 + Tiedostoa voi käyttää vapaasti myös kaupallisesti. + + + + + K1554_2 + K1554_2.jpg + + https://kissarepo/images/download?id=k1554_2&size=thumb + + + https://kissarepo/images/download?id=k1554_2&size=large + + + https://kissarepo/images/download?id=k1554_2&size=original + + + + CC BY 4.0 + Tiedostoa voi käyttää vapaasti myös kaupallisesti. + + + + + + + diff --git a/tests/fixtures/Base/utils/XslTransformation/lido_image_edm.xml b/tests/fixtures/Base/utils/XslTransformation/lido_image_edm.xml new file mode 100644 index 000000000..6b435d820 --- /dev/null +++ b/tests/fixtures/Base/utils/XslTransformation/lido_image_edm.xml @@ -0,0 +1,47 @@ + + + + Karvinen, Osku + mustavalkoinen kissa nukkuu nurmikolla + black and white cat sleeping on grass + Photographing was done while the cat was sleeping because the cat refused to co-operate + salakuvaus + K1554 + fin + kissat + + + Hänen Majesteettinsa Kissa Kissanen + Kissa nurmikolla + + valokuvanegatiivi + 100 valokuva + valmistusaika 2009 + 6 x 6 cm + 6 x 6 cm + Kissakuvakokoelma + Cat image collection + Kissat kautta aikojen - Helsinki Cat Exhibition + negatiivi + kuvauspaikka Kissakuja 1, Helsinki + aiheen paikka Kissakujan nurmikko + 1.11.2022–31.2.2023 + IMAGE + + + + + + + + + + Test Museum + + + + + National Library of Finland + + + diff --git a/tests/fixtures/Base/utils/XslTransformation/lido_text.xml b/tests/fixtures/Base/utils/XslTransformation/lido_text.xml new file mode 100644 index 000000000..12e9e4348 --- /dev/null +++ b/tests/fixtures/Base/utils/XslTransformation/lido_text.xml @@ -0,0 +1,208 @@ + + + + testimuseo-K1554 + + + + + valokuva + + + + + kaunokirjoitus + + + 100 valokuva + + + 12345 + + + + + + + Kissa nurmikolla -kuvan tarina + The story of the image: Cat On Grass + + + + + + + Testimuseo + + + K1554 + + + + + mustavalkoinen kissa nukkuu nurmikolla: kuvauskertomus + black and white cat sleeping on grass: photography report + + + + + 6 x 6 cm + 6 x 6 cm + + + + + + + + valmistus + Creation + + + + + + Karvinen, Osku + + + + kirjoittaja + + + + + valmistusaika 2009 + + + kuvauspaikka Kissakuja 1, Helsinki + + + kaunokirjoitus + + + pergamentti + + + pergamentti + parchment + + + + + Photographing was done while the cat was sleeping because the cat refused to co-operate + + + + + + + näyttely + + + Kissat kautta aikojen - Helsinki Cat Exhibition + + + 1.11.2022–31.2.2023 + + + + + + + + + + Yleinen suomalainen asiasanasto + kissat + + + http://www.yso.fi/onto/yso/p16142 + nurmikot + + + + + + + http://iconclass.org/48C5 + maalaustaide, piirrostaide ja taidegrafiikka + + + + + + + + + Hänen Majesteettinsa Kissa Kissanen + + + + + aiheen paikka Kissakujan nurmikko + + + + + + + + Kissakuvakokoelma + Cat image collection + + + Kokoelma + + + + + + + + K1554 + + item + + + + Testimuseo + + + + + CC0 + julkinen + + + + + + K1554_1 + K1554_1.jpg + + https://kissarepo/images/download?id=k1554_2&size=thumb + + + + CC BY 4.0 + Tiedostoa voi käyttää vapaasti myös kaupallisesti. + + + + + K1554_2 + K1554_2.pdf + + https://kissarepo/images/download?id=k1554_2&size=original&format=pdf + + + + CC BY 4.0 + Tiedostoa voi käyttää vapaasti myös kaupallisesti. + + + + + + + diff --git a/tests/fixtures/Base/utils/XslTransformation/lido_text_edm.xml b/tests/fixtures/Base/utils/XslTransformation/lido_text_edm.xml new file mode 100644 index 000000000..e1dc7e85f --- /dev/null +++ b/tests/fixtures/Base/utils/XslTransformation/lido_text_edm.xml @@ -0,0 +1,48 @@ + + + + Karvinen, Osku + mustavalkoinen kissa nukkuu nurmikolla: kuvauskertomus + black and white cat sleeping on grass: photography report + Photographing was done while the cat was sleeping because the cat refused to co-operate + kaunokirjoitus + K1554 + fin + kissat + + + Hänen Majesteettinsa Kissa Kissanen + Kissa nurmikolla -kuvan tarina + The story of the image: Cat On Grass + + kaunokirjoitus + 100 valokuva + valmistusaika 2009 + 6 x 6 cm + 6 x 6 cm + Kissakuvakokoelma + Cat image collection + Kissat kautta aikojen - Helsinki Cat Exhibition + pergamentti + kuvauspaikka Kissakuja 1, Helsinki + aiheen paikka Kissakujan nurmikko + 1.11.2022–31.2.2023 + TEXT + + + + + + + + + + Test Museum + + + + + National Library of Finland + + + diff --git a/tests/fixtures/Base/utils/XslTransformation/lido_video.xml b/tests/fixtures/Base/utils/XslTransformation/lido_video.xml new file mode 100644 index 000000000..732fc400c --- /dev/null +++ b/tests/fixtures/Base/utils/XslTransformation/lido_video.xml @@ -0,0 +1,256 @@ + + + + testimuseo-K1554 + + + + + + + + + + + + + fin + + + + + + + + + + + + + + Testimuseo + + + K1554 + + + + + mustavalkoinen kissa nukkuu nurmikolla + black and white cat sleeping on grass + + + + + + + pituus + 6 + cm + + + leveys + 6 + cm + + + + + + + + + + valmistus + Creation + + + + + + Karvinen, Osku + + + + kuvaaja + + + + + valmistusaika 2009 + + + kuvauspaikka Kissakuja 1, Helsinki + + + Kissakuja 1 + + + + 60.187796179482426 24.983517601821166 + + + + + Helsinki + + + + Suomi + + + + + + + salakuvaus + + + + + negatiivi + negative + + + + + Photographing was done while the cat was sleeping because the cat refused to co-operate + + + + + + + näyttely + + + Kissat kautta aikojen - Helsinki Cat Exhibition + + + + + + + + + + Yleinen suomalainen asiasanasto + kissat + + + http://www.yso.fi/onto/yso/p16142 + nurmikot + + + + + + + http://iconclass.org/48C5 + maalaustaide, piirrostaide ja taidegrafiikka + + + + + + + + + Hänen Majesteettinsa Kissa Kissanen + + + + + aiheen paikka Kissakujan nurmikko + + + aiheen aika 2000-luku + + + + + + + + Kissakuvakokoelma + Cat image collection + + + Kokoelma + + + + + Katso teos Testimuseon kokoelmasivustolla + + https://www.kansallisgalleria.fi/fi/object/594898 + https://www.kansallisgalleria.fi/en/object/594898 + + + + + + + + + K1554 + + item + + + + Testimuseo + + + + + CC0 + julkinen + + + + + + 924453 + HK19931028_2211.tif + + https://kissarepo/images/download?id=k1554_1&size=thumb + + + https://kissarepo/images/download?id=k1554_1&size=large + + + https://kissarepo/images/download?id=k1554_1&size=master + + + + CC BY 4.0 + Tiedostoa voi käyttää vapaasti myös kaupallisesti. + + Karvinen, Osku + + + + + https://kissarepo/images/download?id=k1554_1&size=original&format=mp4 + + + https://www.youtube.com/watch?v=k1554_1 + + + + InC + In copyright + + + + Testimuseo + + + Testimuseo / Karvinen, Osku + + + + + + diff --git a/tests/fixtures/Base/utils/XslTransformation/lido_video_edm.xml b/tests/fixtures/Base/utils/XslTransformation/lido_video_edm.xml new file mode 100644 index 000000000..bebe8724f --- /dev/null +++ b/tests/fixtures/Base/utils/XslTransformation/lido_video_edm.xml @@ -0,0 +1,61 @@ + + + + Karvinen, Osku + mustavalkoinen kissa nukkuu nurmikolla + black and white cat sleeping on grass + Photographing was done while the cat was sleeping because the cat refused to co-operate + salakuvaus + K1554 + fin + kissat + + + Hänen Majesteettinsa Kissa Kissanen + Ei otsikkoa + + valmistusaika 2009 + pituus: 6 cm + leveys: 6 cm + Kissakuvakokoelma + Cat image collection + Kissat kautta aikojen - Helsinki Cat Exhibition + negatiivi + negative + kuvauspaikka Kissakuja 1, Helsinki + + aiheen paikka Kissakujan nurmikko + aiheen aika 2000-luku + VIDEO + + + + Karvinen, Osku + + + + Testimuseo / Karvinen, Osku + Testimuseo + + + + Testimuseo / Karvinen, Osku + Testimuseo + + + + Test Museum + + + + + + National Library of Finland + + + + Kissakuja 1 + 60.187796179482426 + 24.983517601821166 + + From ced31dfcf8f94486db12d009cba7c1fd9929ad7d Mon Sep 17 00:00:00 2001 From: mshroom <32199029+mshroom@users.noreply.github.com> Date: Wed, 3 Jun 2026 15:13:57 +0300 Subject: [PATCH 2/6] fix errors --- .../Base/Utils/XslTransformationTest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/RecordManagerTest/Base/Utils/XslTransformationTest.php b/tests/RecordManagerTest/Base/Utils/XslTransformationTest.php index 021fdefcc..b2abf0141 100644 --- a/tests/RecordManagerTest/Base/Utils/XslTransformationTest.php +++ b/tests/RecordManagerTest/Base/Utils/XslTransformationTest.php @@ -52,7 +52,7 @@ class XslTransformationTest extends \PHPUnit\Framework\TestCase */ public function testLido2EdmTransformationWithImage() { - $xslTransformation = $this->getXslTransformation("lido2edm_image.properties"); + $xslTransformation = $this->getXslTransformation('lido2edm_image.properties'); $lidoRecord = $this->getFixture('utils/XslTransformation/lido_image.xml'); $expectedEdm = $this->getFixture('utils/XslTransformation/lido_image_edm.xml'); $transformedEdm = $xslTransformation->transform($lidoRecord); @@ -66,7 +66,7 @@ public function testLido2EdmTransformationWithImage() */ public function testLido2EdmTransformationWithVideo() { - $xslTransformation = $this->getXslTransformation("lido2edm_video.properties"); + $xslTransformation = $this->getXslTransformation('lido2edm_video.properties'); $lidoRecord = $this->getFixture('utils/XslTransformation/lido_video.xml'); $expectedEdm = $this->getFixture('utils/XslTransformation/lido_video_edm.xml'); $transformedEdm = $xslTransformation->transform($lidoRecord); @@ -80,7 +80,7 @@ public function testLido2EdmTransformationWithVideo() */ public function testLido2EdmTransformationWithText() { - $xslTransformation = $this->getXslTransformation("lido2edm_text.properties"); + $xslTransformation = $this->getXslTransformation('lido2edm_text.properties'); $lidoRecord = $this->getFixture('utils/XslTransformation/lido_text.xml'); $expectedEdm = $this->getFixture('utils/XslTransformation/lido_text_edm.xml'); $transformedEdm = $xslTransformation->transform($lidoRecord); @@ -94,7 +94,7 @@ public function testLido2EdmTransformationWithText() */ public function testLido2EdmTransformationWith3D() { - $xslTransformation = $this->getXslTransformation("lido2edm_3D.properties"); + $xslTransformation = $this->getXslTransformation('lido2edm_3D.properties'); $lidoRecord = $this->getFixture('utils/XslTransformation/lido_3D.xml'); $expectedEdm = $this->getFixture('utils/XslTransformation/lido_3D_edm.xml'); $transformedEdm = $xslTransformation->transform($lidoRecord); @@ -105,7 +105,7 @@ public function testLido2EdmTransformationWith3D() * Create XmlTransformation * * @param string $config Transformation config file name - * + * * @return XslTransformation */ protected function getXslTransformation(string $config) From 3eac4cd0efb16d93fa6e931541f6f3333034091b Mon Sep 17 00:00:00 2001 From: mshroom <32199029+mshroom@users.noreply.github.com> Date: Wed, 3 Jun 2026 15:45:29 +0300 Subject: [PATCH 3/6] Small edits --- .../config/xsltransformationtest/transformations/lido2edm.xsl | 3 +-- .../transformations/lido2edm_3D.properties | 2 +- tests/fixtures/Base/utils/XslTransformation/lido_3D_edm.xml | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl index 84a70e338..3edfdbde8 100644 --- a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl @@ -23,7 +23,7 @@ - + @@ -744,7 +744,6 @@ - diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_3D.properties b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_3D.properties index a1f330da1..b11b04005 100644 --- a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_3D.properties +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm_3D.properties @@ -27,4 +27,4 @@ data_provider = "Test Museum" ; Default content type if more specific type is missing default_type = "Museum object" ; URL to the preferred Finna view -sourceURL = "http://testmuseum.finna.fi" +sourceURL = "Sketchfab" diff --git a/tests/fixtures/Base/utils/XslTransformation/lido_3D_edm.xml b/tests/fixtures/Base/utils/XslTransformation/lido_3D_edm.xml index 96b9e5637..c141cee8b 100644 --- a/tests/fixtures/Base/utils/XslTransformation/lido_3D_edm.xml +++ b/tests/fixtures/Base/utils/XslTransformation/lido_3D_edm.xml @@ -53,7 +53,7 @@ Test Museum - + From 09e358d17362afa0a2c9f10f49ff9fa611ec9d1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minna=20R=C3=B6nk=C3=A4?= <32199029+mshroom@users.noreply.github.com> Date: Thu, 4 Jun 2026 12:19:03 +0300 Subject: [PATCH 4/6] Update tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl Co-authored-by: Ere Maijala --- .../config/xsltransformationtest/transformations/lido2edm.xsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl index 3edfdbde8..42323c379 100644 --- a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl @@ -386,7 +386,7 @@ - + From e67cf19e9dee68301fc279aed885c1aeb2231e8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minna=20R=C3=B6nk=C3=A4?= <32199029+mshroom@users.noreply.github.com> Date: Thu, 4 Jun 2026 12:19:13 +0300 Subject: [PATCH 5/6] Update tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl Co-authored-by: Ere Maijala --- .../config/xsltransformationtest/transformations/lido2edm.xsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl index 42323c379..64ec8ad55 100644 --- a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl @@ -143,7 +143,7 @@ - + From f3245480f543ed3c627bca0983cdd1e2c2163f74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minna=20R=C3=B6nk=C3=A4?= <32199029+mshroom@users.noreply.github.com> Date: Thu, 4 Jun 2026 12:19:22 +0300 Subject: [PATCH 6/6] Update tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl Co-authored-by: Ere Maijala --- .../config/xsltransformationtest/transformations/lido2edm.xsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl index 64ec8ad55..bcf0a3fd3 100644 --- a/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl +++ b/tests/fixtures/Base/config/xsltransformationtest/transformations/lido2edm.xsl @@ -250,7 +250,7 @@ - +