/** * SCENARIO OUTLINE: see FunctionalDoiExportTest::testExportUnregisteredDois(). * * EXAMPLES: * export plug-in |objects |XML files * =================|======================================|============================================================================== * MedraExportPlugin|issue 1; article 1; galleys 1, 2 and 3|serial-article-as-{work,manifestation}-2.xml,serial-issue-as-manifestation.xml */ public function testExportUnregisteredDois() { $this->removeRegisteredDois('MedraExportPlugin'); $this->configurePlugin(array('exportIssuesAs' => O4DOI_ISSUE_AS_MANIFESTATION)); // Test whether exporting updates changes correctly // sets the notification type. $pluginInstance = $this->instantiatePlugin('MedraExportPlugin'); $hookName = 'articledao::getAdditionalFieldNames'; HookRegistry::register($hookName, array($pluginInstance, 'getAdditionalFieldNames')); $articleDao = DAORegistry::getDAO('ArticleDAO'); $testObject = $articleDao->getArticle(1); $testObject->setData('medra::' . DOI_EXPORT_REGDOI, '1749/t.v1i1.1'); $articleDao->updateArticle($testObject); // Remove the hook. $hooks = HookRegistry::getHooks(); foreach ($hooks[$hookName] as $index => $hook) { if (is_a($hook[0], 'MedraExportPlugin')) { unset($hooks[$hookName][$index]); break; } } $objects = array('issue' => 1, 'article' => 1, 'galley' => array(1, 2, 3)); $xmlFiles = array('serial-article-as-work-2.xml', 'serial-article-as-manifestation-2.xml', 'serial-issue-as-manifestation.xml'); parent::testExportUnregisteredDois('MedraExportPlugin', $objects, $xmlFiles); }
/** * SCENARIO OUTLINE: see FunctionalDoiExportTest::testExportUnregisteredDois(). * * EXAMPLES: * export plug-in |objects |XML files * ====================|===================================================|========================================================================================== * DataciteExportPlugin|issue 1; article 1; galleys 1, 2 and 3|datacite-article.xml,datacite-galley-{1,2,3}.xml,datacite-issue.xml */ public function testExportUnregisteredDois() { $objects = array('issue' => 1, 'article' => 1, 'galley' => array(1, 2, 3)); $xmlFiles = array('datacite-article.xml', 'datacite-galley-1.xml', 'datacite-galley-2.xml', 'datacite-galley-3.xml', 'datacite-issue.xml'); parent::testExportUnregisteredDois('DataciteExportPlugin', $objects, $xmlFiles); }