Skip to content

Commit

Permalink
Add tests for CalendarController
Browse files Browse the repository at this point in the history
  • Loading branch information
oliver-stoehr committed May 12, 2023
1 parent b3d02f4 commit f31a8fb
Show file tree
Hide file tree
Showing 5 changed files with 602 additions and 5 deletions.
155 changes: 155 additions & 0 deletions Tests/Fixtures/Controller/documents_calendar.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
<?xml version="1.0" encoding="utf-8"?>
<dataset>
<tx_dlf_documents>
<uid>2001</uid>
<pid>0</pid>
<tstamp>1631775000</tstamp>
<crdate>1631775000</crdate>
<cruser_id>2</cruser_id>
<deleted>0</deleted>
<hidden>0</hidden>
<starttime>0</starttime>
<endtime>0</endtime>
<fe_group />
<prod_id />
<location>http://web:8001/Tests/Fixtures/Controller/mets_newspaper_issues.xml</location>
<record_id>oai:de:slub-dresden:db:id-476251419</record_id>
<opac_id>476251419</opac_id>
<union_id>476251419</union_id>
<urn>urn:nbn:de:bsz:14-db-id4762514197</urn>
<purl>http://digital.slub-dresden.de/id476251419</purl>
<title>10 Keyboard pieces - Go. S. 658</title>
<title_sorting>10 Keyboard pieces - Go. S. 658</title_sorting>
<author />
<year>[1759-1800]</year>
<place>[S.l.]</place>
<thumbnail>https://digital.slub-dresden.de/data/kitodo/10Kepi_476251419/10Kepi_476251419_tif/jpegs/00000003.tif.thumbnail.jpg</thumbnail>
<structure>59</structure>
<partof>0</partof>
<volume />
<volume_sorting />
<license />
<terms />
<restrictions />
<out_of_print />
<rights_info />
<collections />
<mets_label>10 Keyboard pieces - Go. S. 658</mets_label>
<mets_orderlabel>10 Keyboard pieces - Go. S. 658</mets_orderlabel>
<owner>10001</owner>
<solrcore>1</solrcore> <!-- may be overridden in test -->
<status>0</status>
<document_format>METS</document_format>
</tx_dlf_documents>

<tx_dlf_documents>
<uid>2002</uid>
<pid>0</pid>
<tstamp>1631774000</tstamp>
<crdate>1631774000</crdate>
<cruser_id>2</cruser_id>
<deleted>0</deleted>
<hidden>0</hidden>
<starttime>0</starttime>
<endtime>0</endtime>
<fe_group />
<prod_id />
<location>http://web:8001/Tests/Fixtures/Controller/mets_newspaper.xml</location>
<opac_id>476248086</opac_id>
<union_id>476248086</union_id>
<title>Newspaper for testing purposes</title>
<title_sorting>Newspaper for testing purposes</title_sorting>
<author />
<year>[1840-1860]</year>
<place>[S.l.]</place>
<thumbnail>https://digital.slub-dresden.de/data/kitodo/6Saso_476248086/6Saso_476248086_tif/jpegs/00000001.tif.thumbnail.jpg</thumbnail>
<structure>59</structure>
<partof>0</partof>
<volume />
<volume_sorting />
<license />
<terms />
<restrictions />
<out_of_print />
<rights_info />
<collections />
<mets_label>6 Sacred songs - Go. S. 591</mets_label>
<mets_orderlabel>6 Sacred songs - Go. S. 591</mets_orderlabel>
<owner>10001</owner>
<solrcore>1</solrcore>
<status>0</status>
<document_format>METS</document_format>
</tx_dlf_documents>

<tx_dlf_documents>
<uid>2003</uid>
<pid>0</pid>
<tstamp>1631776000</tstamp>
<crdate>1631776000</crdate>
<cruser_id>2</cruser_id>
<deleted>0</deleted>
<hidden>0</hidden>
<starttime>0</starttime>
<endtime>0</endtime>
<fe_group />
<prod_id />
<location>https://digital.slub-dresden.de/data/kitodo/6FuG_476251729/6FuG_476251729_mets.xml</location>
<record_id>oai:de:slub-dresden:db:id-476251729</record_id>
<opac_id>476251729</opac_id>
<union_id>476251729</union_id>
<urn>urn:nbn:de:bsz:14-db-id4762517292</urn>
<purl>http://digital.slub-dresden.de/id476251729</purl>
<title>6 Fugues - Go. S. 317</title>
<title_sorting>6 Fugues - Go. S. 317</title_sorting>
<author />
<year>[um 1820]</year>
<place>[S.l.]</place>
<thumbnail>https://digital.slub-dresden.de/data/kitodo/6FuG_476251729/6FuG_476251729_tif/jpegs/00000001.tif.thumbnail.jpg</thumbnail>
<structure>59</structure>
<partof>0</partof>
<volume />
<volume_sorting />
<license />
<terms />
<restrictions />
<out_of_print />
<rights_info />
<collections>3</collections>
<mets_label>6 Fugues - Go. S. 317</mets_label>
<mets_orderlabel>6 Fugues - Go. S. 317</mets_orderlabel>
<owner>10001</owner>
<solrcore>1</solrcore>
<status>0</status>
<document_format>METS</document_format>
</tx_dlf_documents>

<tx_dlf_relations>
<uid>2201</uid>
<uid_local>2001</uid_local>
<uid_foreign>1</uid_foreign>
<tablenames />
<sorting />
<sorting_foreign />
<ident>docs_colls</ident>
</tx_dlf_relations>

<tx_dlf_relations>
<uid>2202</uid>
<uid_local>2002</uid_local>
<uid_foreign>1</uid_foreign>
<tablenames />
<sorting />
<sorting_foreign />
<ident>docs_colls</ident>
</tx_dlf_relations>

<tx_dlf_relations>
<uid>2203</uid>
<uid_local>2003</uid_local>
<uid_foreign>1</uid_foreign>
<tablenames />
<sorting />
<sorting_foreign />
<ident>docs_colls</ident>
</tx_dlf_relations>
</dataset>
113 changes: 113 additions & 0 deletions Tests/Fixtures/Controller/metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="utf-8"?>
<dataset>
<tx_dlf_metadata>
<uid>5001</uid>
<pid>2</pid>
<tstamp>1638557803</tstamp>
<crdate>1631532810</crdate>
<cruser_id>1</cruser_id>
<deleted>0</deleted>
<sys_language_uid>0</sys_language_uid>
<l18n_parent>0</l18n_parent>
<l18n_diffsource></l18n_diffsource>
<hidden>0</hidden>
<sorting>32</sorting>
<l10n_state></l10n_state>
<label>Titel</label>
<index_name>title</index_name>
<format>1</format>
<default_value></default_value>
<wrap></wrap>
<index_tokenized>0</index_tokenized>
<index_stored>1</index_stored>
<index_indexed>1</index_indexed>
<index_boost>1</index_boost>
<is_sortable>1</is_sortable>
<is_facet>0</is_facet>
<is_listed>1</is_listed>
<index_autocomplete>1</index_autocomplete>
<status>0</status>
</tx_dlf_metadata>

<tx_dlf_metadata>
<uid>5002</uid>
<pid>2</pid>
<tstamp>1638557803</tstamp>
<crdate>1631532810</crdate>
<cruser_id>1</cruser_id>
<deleted>0</deleted>
<sys_language_uid>0</sys_language_uid>
<l18n_parent>0</l18n_parent>
<l18n_diffsource></l18n_diffsource>
<hidden>0</hidden>
<sorting>32</sorting>
<l10n_state></l10n_state>
<label>Sammlungen</label>
<index_name>collection</index_name>
<format>1</format>
<default_value></default_value>
<wrap></wrap>
<index_tokenized>1</index_tokenized>
<index_stored>0</index_stored>
<index_indexed>1</index_indexed>
<index_boost>1</index_boost>
<is_sortable>0</is_sortable>
<is_facet>1</is_facet>
<is_listed>0</is_listed>
<index_autocomplete>1</index_autocomplete>
<status>0</status>
</tx_dlf_metadata>

<tx_dlf_metadataformat>
<uid>5101</uid>
<pid>2</pid>
<tstamp>1638557803</tstamp>
<crdate>1631532810</crdate>
<cruser_id>1</cruser_id>
<deleted>0</deleted>
<parent_id>5001</parent_id>
<encoded>5202</encoded> <!-- refers to tx_dlf_formats (it's a MODS field) -->
<xpath>concat(./mods:titleInfo/mods:nonSort," ",./mods:titleInfo/mods:title)</xpath>
<xpath_sorting>./mods:titleInfo/mods:title</xpath_sorting>
<mandatory>0</mandatory>
</tx_dlf_metadataformat>

<tx_dlf_metadataformat>
<uid>5102</uid>
<pid>2</pid>
<tstamp>1638557803</tstamp>
<crdate>1631532810</crdate>
<cruser_id>1</cruser_id>
<deleted>0</deleted>
<parent_id>5002</parent_id>
<encoded>5202</encoded>
<xpath>./mods:relatedItem[@type="series"]/mods:titleInfo/mods:title[@lang="ger"]</xpath>
<xpath_sorting />
<mandatory>0</mandatory>
</tx_dlf_metadataformat>

<tx_dlf_formats>
<uid>5201</uid>
<pid>0</pid>
<tstamp>1638557803</tstamp>
<crdate>1631532810</crdate>
<cruser_id>1</cruser_id>
<deleted>0</deleted>
<type>ALTO</type>
<root>alto</root>
<namespace>http://www.loc.gov/standards/alto/ns-v2#</namespace>
<class>Kitodo\Dlf\Format\Alto</class>
</tx_dlf_formats>
<tx_dlf_formats>
<uid>5202</uid>
<pid>0</pid>
<tstamp>1638557803</tstamp>
<crdate>1631532810</crdate>
<cruser_id>1</cruser_id>
<deleted>0</deleted>
<type>MODS</type>
<root>mods</root>
<namespace>http://www.loc.gov/mods/v3</namespace>
<class>Kitodo\Dlf\Format\Mods</class>
</tx_dlf_formats>
</dataset>
125 changes: 125 additions & 0 deletions Tests/Fixtures/Controller/mets_newspaper.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<mets:mets xmlns:mets="http://www.loc.gov/METS/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/mods.xsd http://www.loc.gov/METS/ http://www.loc.gov/standards/mets/mets.xsd">
<mets:metsHdr CREATEDATE="2020-08-03T10:16:07">
<mets:agent OTHERTYPE="SOFTWARE" ROLE="CREATOR" TYPE="OTHER">
<mets:name>
Kitodo - kitodo-ugh-2.1.3-kitodo-ugh-2.1.1-11-g4b06eaa - 30−July−2019
</mets:name>
<mets:note>Kitodo</mets:note>
</mets:agent>
</mets:metsHdr>
<mets:dmdSec ID="DMDLOG_0000">
<mets:mdWrap MDTYPE="MODS">
<mets:xmlData>
<mods:mods xmlns:mods="http://www.loc.gov/mods/v3">
<mods:location>
<mods:physicalLocation>Kitodo.Presentation Repository</mods:physicalLocation>
<mods:shelfLocator>1234</mods:shelfLocator>
</mods:location>
<mods:recordInfo>
<mods:recordIdentifier>123456789</mods:recordIdentifier>
</mods:recordInfo>
<mods:identifier type="ppn">123456789</mods:identifier>
<mods:titleInfo>
<mods:title>Newspaper for testing purposes</mods:title>
</mods:titleInfo>
<mods:originInfo eventType="publication">
<mods:place>
<mods:placeTerm type="text">Presentation Repository</mods:placeTerm>
</mods:place>
<mods:dateIssued keyDate="yes">[1759-1800]</mods:dateIssued>
<mods:dateOther encoding="w3cdtf" type="order">1800</mods:dateOther>
</mods:originInfo>
</mods:mods>
</mets:xmlData>
</mets:mdWrap>
</mets:dmdSec>
<mets:dmdSec ID="DMDLOG_0001">
<mets:mdWrap MDTYPE="MODS">
<mets:xmlData>
<mods:mods xmlns:mods="http://www.loc.gov/mods/v3">
<mods:titleInfo>
<mods:title>Table of contents</mods:title>
</mods:titleInfo>
</mods:mods>
</mets:xmlData>
</mets:mdWrap>
</mets:dmdSec>
<mets:dmdSec ID="DMDPHYS_0000">
<mets:mdWrap MDTYPE="MODS">
<mets:xmlData>
<mods:mods xmlns:mods="http://www.loc.gov/mods/v3">
<mods:physicalDescription>
<mods:extent>24,5 x 33 cm</mods:extent>
</mods:physicalDescription>
</mods:mods>
</mets:xmlData>
</mets:mdWrap>
</mets:dmdSec>
<mets:fileSec>
<mets:fileGrp USE="THUMBS">
<mets:file ID="FILE_0001_THUMBS" MIMETYPE="image/jpeg">
<mets:FLocat xmlns:xlink="http://www.w3.org/1999/xlink" LOCTYPE="URL" xlink:href="http://web:8001/Tests/Fixtures/Controller/mets_local/jpegs/00000001.tif.thumbnail.jpg"/>
</mets:file>
<mets:file ID="FILE_0002_THUMBS" MIMETYPE="image/jpeg">
<mets:FLocat xmlns:xlink="http://www.w3.org/1999/xlink" LOCTYPE="URL" xlink:href="http://web:8001/Tests/Fixtures/Controller/mets_local/jpegs/00000002.tif.thumbnail.jpg"/>
</mets:file>
</mets:fileGrp>
<mets:fileGrp USE="MAX">
<mets:file ID="FILE_0001_MAX" MIMETYPE="image/jpeg">
<mets:FLocat xmlns:xlink="http://www.w3.org/1999/xlink" LOCTYPE="URL" xlink:href="http://web:8001/Tests/Fixtures/Controller/mets_local/jpegs/00000001.tif.large.jpg"/>
</mets:file>
<mets:file ID="FILE_0002_MAX" MIMETYPE="image/jpeg">
<mets:FLocat xmlns:xlink="http://www.w3.org/1999/xlink" LOCTYPE="URL" xlink:href="http://web:8001/Tests/Fixtures/Controller/mets_local/jpegs/00000002.tif.large.jpg"/>
</mets:file>
</mets:fileGrp>
<mets:fileGrp USE="DOWNLOAD">
<mets:file ID="FILE_0001_DOWNLOAD" MIMETYPE="application/pdf">
<mets:FLocat xmlns:xlink="http://www.w3.org/1999/xlink" LOCTYPE="URL" xlink:href="http://web:8001/Tests/Fixtures/Controller/mets_local/jpegs/00000001.tif.pdf"/>
</mets:file>
<mets:file ID="FILE_0002_DOWNLOAD" MIMETYPE="application/pdf">
<mets:FLocat xmlns:xlink="http://www.w3.org/1999/xlink" LOCTYPE="URL" xlink:href="http://web:8001/Tests/Fixtures/Controller/mets_local/jpegs/00000002.tif.pdf"/>
</mets:file>
<mets:file ID="FULLDOWNLOAD" MIMETYPE="application/pdf">
<mets:FLocat xmlns:xlink="http://www.w3.org/1999/xlink" LOCTYPE="URL" xlink:href="http://web:8001/Tests/Fixtures/Controller/mets_local/jpegs/full.pdf"/>
</mets:file>
</mets:fileGrp>
<mets:fileGrp USE="FULLTEXT">
<mets:file ID="FILE_0001_FULLTEXT" MIMETYPE="text/plain">
<mets:FLocat xmlns:xlink="http://www.w3.org/1999/xlink" LOCTYPE="URL" xlink:href="http://web:8001/Tests/Fixtures/Controller/mets_local/jpegs/00000001.tif.txt"/>
</mets:file>
<mets:file ID="FILE_0002_FULLTEXT" MIMETYPE="text/plain">
<mets:FLocat xmlns:xlink="http://www.w3.org/1999/xlink" LOCTYPE="URL" xlink:href="http://web:8001/Tests/Fixtures/Controller/mets_local/jpegs/00000002.tif.txt"/>
</mets:file>
</mets:fileGrp>
</mets:fileSec>
<mets:structMap TYPE="LOGICAL">
<mets:div CONTENTIDS="http://web:8001/Tests/Fixtures/Controller/mets_local/id/476251419" DMDID="DMDLOG_0000" ID="LOG_0000" LABEL="Test Newspaper" ORDERLABEL="Test Newspaper" TYPE="newspaper">
<mets:div ID="LOG_0002" LABEL="2021" TYPE="year"/>
<mets:div ID="LOG_0003" LABEL="2022" TYPE="year"/>
<mets:div ID="LOG_0004" LABEL="2023" TYPE="year"/>
</mets:div>
</mets:structMap>
<mets:structMap TYPE="PHYSICAL">
<mets:div DMDID="DMDPHYS_0000" ID="PHYS_0000" TYPE="physSequence">
<mets:fptr FILEID="FULLDOWNLOAD"/>
<mets:div ID="PHYS_0001" ORDER="1" ORDERLABEL=" - " TYPE="page">
<mets:fptr FILEID="FILE_0001_THUMBS"/>
<mets:fptr FILEID="FILE_0001_MAX"/>
<mets:fptr FILEID="FILE_0001_DOWNLOAD"/>
<mets:fptr FILEID="FILE_0001_FULLTEXT"/>
</mets:div>
<mets:div ID="PHYS_0002" ORDER="2" ORDERLABEL="1" TYPE="page">
<mets:fptr FILEID="FILE_0002_THUMBS"/>
<mets:fptr FILEID="FILE_0002_MAX"/>
<mets:fptr FILEID="FILE_0002_DOWNLOAD"/>
<mets:fptr FILEID="FILE_0002_FULLTEXT"/>
</mets:div>
</mets:div>
</mets:structMap>
<mets:structLink>
<mets:smLink xmlns:xlink="http://www.w3.org/1999/xlink" xlink:to="PHYS_0001" xlink:from="LOG_0000"/>
<mets:smLink xmlns:xlink="http://www.w3.org/1999/xlink" xlink:to="PHYS_0002" xlink:from="LOG_0000"/>
<mets:smLink xmlns:xlink="http://www.w3.org/1999/xlink" xlink:to="PHYS_0001" xlink:from="LOG_0001"/>
<mets:smLink xmlns:xlink="http://www.w3.org/1999/xlink" xlink:to="PHYS_0002" xlink:from="LOG_0001"/>
</mets:structLink>
</mets:mets>
Loading

0 comments on commit f31a8fb

Please sign in to comment.