-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
04b749b
commit daaeff2
Showing
2 changed files
with
287 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,181 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<dataset> | ||
<!-- Default siteroot --> | ||
<pages> | ||
<uid>19999</uid> | ||
<pid>0</pid> | ||
<tstamp>1644840191</tstamp> | ||
<crdate>1644840051</crdate> | ||
<cruser_id>1</cruser_id> | ||
<deleted>0</deleted> | ||
<hidden>0</hidden> | ||
<starttime>0</starttime> | ||
<endtime>0</endtime> | ||
<fe_group></fe_group> | ||
<sorting>764</sorting> | ||
<rowDescription></rowDescription> | ||
<editlock>0</editlock> | ||
<sys_language_uid>0</sys_language_uid> | ||
<l10n_parent>0</l10n_parent> | ||
<l10n_source>0</l10n_source> | ||
<l10n_state></l10n_state> | ||
<t3_origuid>0</t3_origuid> | ||
<l10n_diffsource>a:47:{s:7:"doktype";N;s:5:"title";N;s:4:"slug";N;s:9:"nav_title";N;s:8:"subtitle";N;s:9:"seo_title";N;s:8:"no_index";N;s:9:"no_follow";N;s:14:"canonical_link";N;s:8:"og_title";N;s:14:"og_description";N;s:8:"og_image";N;s:13:"twitter_title";N;s:19:"twitter_description";N;s:13:"twitter_image";N;s:8:"abstract";N;s:8:"keywords";N;s:11:"description";N;s:6:"author";N;s:12:"author_email";N;s:11:"lastUpdated";N;s:6:"layout";N;s:8:"newUntil";N;s:14:"backend_layout";N;s:25:"backend_layout_next_level";N;s:16:"content_from_pid";N;s:6:"target";N;s:13:"cache_timeout";N;s:10:"cache_tags";N;s:11:"is_siteroot";N;s:9:"no_search";N;s:13:"php_tree_stop";N;s:6:"module";N;s:5:"media";N;s:17:"tsconfig_includes";N;s:8:"TSconfig";N;s:8:"l18n_cfg";N;s:6:"hidden";N;s:8:"nav_hide";N;s:9:"starttime";N;s:7:"endtime";N;s:16:"extendToSubpages";N;s:8:"fe_group";N;s:13:"fe_login_mode";N;s:8:"editlock";N;s:10:"categories";N;s:14:"rowDescription";N;}</l10n_diffsource> | ||
<t3ver_oid>0</t3ver_oid> | ||
<t3ver_wsid>0</t3ver_wsid> | ||
<t3ver_state>0</t3ver_state> | ||
<t3ver_stage>0</t3ver_stage> | ||
<t3ver_count>0</t3ver_count> | ||
<t3ver_tstamp>0</t3ver_tstamp> | ||
<t3ver_move_id>0</t3ver_move_id> | ||
<perms_userid>1</perms_userid> | ||
<perms_groupid>0</perms_groupid> | ||
<perms_user>31</perms_user> | ||
<perms_group>27</perms_group> | ||
<perms_everybody>0</perms_everybody> | ||
<title>DLF Testing Site</title> | ||
<slug>/</slug> | ||
<doktype>254</doktype> | ||
<TSconfig></TSconfig> | ||
<is_siteroot>1</is_siteroot> | ||
<php_tree_stop>0</php_tree_stop> | ||
<url></url> | ||
<shortcut>0</shortcut> | ||
<shortcut_mode>0</shortcut_mode> | ||
<subtitle></subtitle> | ||
<layout>0</layout> | ||
<target></target> | ||
<media>0</media> | ||
<lastUpdated>0</lastUpdated> | ||
<keywords></keywords> | ||
<cache_timeout>0</cache_timeout> | ||
<cache_tags></cache_tags> | ||
<newUntil>0</newUntil> | ||
<description></description> | ||
<no_search>0</no_search> | ||
<SYS_LASTCHANGED>1644840191</SYS_LASTCHANGED> | ||
<abstract></abstract> | ||
<module></module> | ||
<extendToSubpages>0</extendToSubpages> | ||
<author></author> | ||
<author_email></author_email> | ||
<nav_title></nav_title> | ||
<nav_hide>0</nav_hide> | ||
<content_from_pid>0</content_from_pid> | ||
<mount_pid>0</mount_pid> | ||
<mount_pid_ol>0</mount_pid_ol> | ||
<l18n_cfg>0</l18n_cfg> | ||
<fe_login_mode>0</fe_login_mode> | ||
<backend_layout></backend_layout> | ||
<backend_layout_next_level></backend_layout_next_level> | ||
<tsconfig_includes></tsconfig_includes> | ||
<legacy_overlay_uid>0</legacy_overlay_uid> | ||
<categories>0</categories> | ||
</pages> | ||
|
||
<!-- Default data folder --> | ||
<pages> | ||
<uid>20000</uid> | ||
<pid>19999</pid> | ||
<tstamp>1644840191</tstamp> | ||
<crdate>1644840051</crdate> | ||
<cruser_id>1</cruser_id> | ||
<deleted>0</deleted> | ||
<hidden>0</hidden> | ||
<starttime>0</starttime> | ||
<endtime>0</endtime> | ||
<fe_group></fe_group> | ||
<sorting>764</sorting> | ||
<rowDescription></rowDescription> | ||
<editlock>0</editlock> | ||
<sys_language_uid>0</sys_language_uid> | ||
<l10n_parent>0</l10n_parent> | ||
<l10n_source>0</l10n_source> | ||
<l10n_state></l10n_state> | ||
<t3_origuid>0</t3_origuid> | ||
<l10n_diffsource>a:47:{s:7:"doktype";N;s:5:"title";N;s:4:"slug";N;s:9:"nav_title";N;s:8:"subtitle";N;s:9:"seo_title";N;s:8:"no_index";N;s:9:"no_follow";N;s:14:"canonical_link";N;s:8:"og_title";N;s:14:"og_description";N;s:8:"og_image";N;s:13:"twitter_title";N;s:19:"twitter_description";N;s:13:"twitter_image";N;s:8:"abstract";N;s:8:"keywords";N;s:11:"description";N;s:6:"author";N;s:12:"author_email";N;s:11:"lastUpdated";N;s:6:"layout";N;s:8:"newUntil";N;s:14:"backend_layout";N;s:25:"backend_layout_next_level";N;s:16:"content_from_pid";N;s:6:"target";N;s:13:"cache_timeout";N;s:10:"cache_tags";N;s:11:"is_siteroot";N;s:9:"no_search";N;s:13:"php_tree_stop";N;s:6:"module";N;s:5:"media";N;s:17:"tsconfig_includes";N;s:8:"TSconfig";N;s:8:"l18n_cfg";N;s:6:"hidden";N;s:8:"nav_hide";N;s:9:"starttime";N;s:7:"endtime";N;s:16:"extendToSubpages";N;s:8:"fe_group";N;s:13:"fe_login_mode";N;s:8:"editlock";N;s:10:"categories";N;s:14:"rowDescription";N;}</l10n_diffsource> | ||
<t3ver_oid>0</t3ver_oid> | ||
<t3ver_wsid>0</t3ver_wsid> | ||
<t3ver_state>0</t3ver_state> | ||
<t3ver_stage>0</t3ver_stage> | ||
<t3ver_count>0</t3ver_count> | ||
<t3ver_tstamp>0</t3ver_tstamp> | ||
<t3ver_move_id>0</t3ver_move_id> | ||
<perms_userid>1</perms_userid> | ||
<perms_groupid>0</perms_groupid> | ||
<perms_user>31</perms_user> | ||
<perms_group>27</perms_group> | ||
<perms_everybody>0</perms_everybody> | ||
<title>Data</title> | ||
<slug>/data</slug> | ||
<doktype>254</doktype> | ||
<TSconfig></TSconfig> | ||
<is_siteroot>0</is_siteroot> | ||
<php_tree_stop>0</php_tree_stop> | ||
<url></url> | ||
<shortcut>0</shortcut> | ||
<shortcut_mode>0</shortcut_mode> | ||
<subtitle></subtitle> | ||
<layout>0</layout> | ||
<target></target> | ||
<media>0</media> | ||
<lastUpdated>0</lastUpdated> | ||
<keywords></keywords> | ||
<cache_timeout>0</cache_timeout> | ||
<cache_tags></cache_tags> | ||
<newUntil>0</newUntil> | ||
<description></description> | ||
<no_search>0</no_search> | ||
<SYS_LASTCHANGED>1644840191</SYS_LASTCHANGED> | ||
<abstract></abstract> | ||
<module></module> | ||
<extendToSubpages>0</extendToSubpages> | ||
<author></author> | ||
<author_email></author_email> | ||
<nav_title></nav_title> | ||
<nav_hide>0</nav_hide> | ||
<content_from_pid>0</content_from_pid> | ||
<mount_pid>0</mount_pid> | ||
<mount_pid_ol>0</mount_pid_ol> | ||
<l18n_cfg>0</l18n_cfg> | ||
<fe_login_mode>0</fe_login_mode> | ||
<backend_layout></backend_layout> | ||
<backend_layout_next_level></backend_layout_next_level> | ||
<tsconfig_includes></tsconfig_includes> | ||
<legacy_overlay_uid>0</legacy_overlay_uid> | ||
<categories>0</categories> | ||
</pages> | ||
|
||
<sys_template> | ||
<uid>21001</uid> | ||
<pid>19999</pid> | ||
<tstamp>1644856416</tstamp> | ||
<crdate>1644856388</crdate> | ||
<cruser_id>1</cruser_id> | ||
<deleted>0</deleted> | ||
<hidden>0</hidden> | ||
<starttime>0</starttime> | ||
<endtime>0</endtime> | ||
<sorting>256</sorting> | ||
<description></description> | ||
<t3_origuid>0</t3_origuid> | ||
<t3ver_oid>0</t3ver_oid> | ||
<t3ver_wsid>0</t3ver_wsid> | ||
<t3ver_state>0</t3ver_state> | ||
<t3ver_stage>0</t3ver_stage> | ||
<t3ver_count>0</t3ver_count> | ||
<t3ver_tstamp>0</t3ver_tstamp> | ||
<t3ver_move_id>0</t3ver_move_id> | ||
<title>OAI-PMH Template</title> | ||
<sitetitle></sitetitle> | ||
<root>1</root> | ||
<clear>3</clear> | ||
<include_static_file>EXT:fluid_styled_content/Configuration/TypoScript/,EXT:dlf/Configuration/TypoScript/Plugins/OaiPmh/,EXT:dlf/Configuration/TypoScript/</include_static_file> | ||
<constants>plugin.tx_dlf.persistence.storagePid = 20000</constants> | ||
<config></config> | ||
<basedOn></basedOn> | ||
<includeStaticAfterBasedOn>0</includeStaticAfterBasedOn> | ||
<static_file_mode>0</static_file_mode> | ||
</sys_template> | ||
|
||
</dataset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
<?php | ||
|
||
/** | ||
* (c) Kitodo. Key to digital objects e.V. <[email protected]> | ||
* | ||
* This file is part of the Kitodo and TYPO3 projects. | ||
* | ||
* @license GNU General Public License version 3 or later. | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Kitodo\Dlf\Tests\Functional\Hooks; | ||
|
||
use Kitodo\Dlf\Domain\Repository\DocumentRepository; | ||
use Kitodo\Dlf\Hooks\ItemsProcFunc; | ||
use Kitodo\Dlf\Tests\Functional\FunctionalTestCase; | ||
use TYPO3\CMS\Core\Localization\LanguageService; | ||
use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager; | ||
|
||
class ItemsProcFuncTest extends FunctionalTestCase | ||
{ | ||
public function setUp(): void | ||
{ | ||
parent::setUp(); | ||
|
||
$this->importDataSet(__DIR__ . '/../../Fixtures/Hooks/pages.xml'); | ||
$this->importDataSet(__DIR__ . '/../../Fixtures/Hooks/metadata.xml'); | ||
$this->persistenceManager = $this->objectManager->get(PersistenceManager::class); | ||
$this->documentRepository = $this->initializeRepository(DocumentRepository::class, 0); | ||
|
||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function canToollist() | ||
{ | ||
$GLOBALS['LANG'] = LanguageService::create('default'); | ||
$itemsProcFunc = new ItemsProcFunc(); | ||
|
||
$params = []; | ||
$itemsProcFunc->toolList($params); | ||
$expected = [ | ||
'items' => [ | ||
['Fulltext', 'tx_dlf_fulltexttool'], | ||
['IIIF Annotations', 'tx_dlf_annotationtool'], | ||
['Fulltext Download', 'tx_dlf_fulltextdownloadtool'], | ||
['Image Download', 'tx_dlf_imagedownloadtool'], | ||
['Image Manipulation', 'tx_dlf_imagemanipulationtool'], | ||
['PDF Download', 'tx_dlf_pdfdownloadtool'], | ||
['Search in Document', 'tx_dlf_searchindocumenttool'] | ||
] | ||
]; | ||
$this->assertEquals($expected, $params); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function canExtendedSearchList() | ||
{ | ||
$itemsProcFunc = new ItemsProcFunc(); | ||
|
||
$params = [ | ||
'flexParentDatabaseRow' => [ | ||
'pid' => 19999 | ||
] | ||
]; | ||
$itemsProcFunc->extendedSearchList($params); | ||
$expected = [ | ||
'items' => [ | ||
['Sammlungen', 'collection'], | ||
['Titel', 'title'] | ||
], | ||
'flexParentDatabaseRow' => [ | ||
'pid' => 19999 | ||
] | ||
]; | ||
$this->assertEquals($expected, $params); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function canGetFacetList() | ||
{ | ||
$itemsProcFunc = new ItemsProcFunc(); | ||
|
||
$params = [ | ||
'flexParentDatabaseRow' => [ | ||
'pid' => 19999 | ||
] | ||
]; | ||
$itemsProcFunc->getFacetsList($params); | ||
$expected = [ | ||
'items' => [ | ||
['Sammlungen', 'collection'] | ||
], | ||
'flexParentDatabaseRow' => [ | ||
'pid' => 19999 | ||
] | ||
]; | ||
$this->assertEquals($expected, $params); | ||
} | ||
} |