当前位置: 首页>>代码示例>>PHP>>正文


PHP PersistableFilter::tempGroup方法代码示例

本文整理汇总了PHP中PersistableFilter::tempGroup方法的典型用法代码示例。如果您正苦于以下问题:PHP PersistableFilter::tempGroup方法的具体用法?PHP PersistableFilter::tempGroup怎么用?PHP PersistableFilter::tempGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PersistableFilter的用法示例。


在下文中一共展示了PersistableFilter::tempGroup方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testInstantiationAndExecute

 /**
  * @covers PersistableFilter
  */
 public function testInstantiationAndExecute()
 {
     $constructorArg = PersistableFilter::tempGroup('class::lib.pkp.tests.classes.filter.TestClass1', 'class::lib.pkp.tests.classes.filter.TestClass2');
     $testFilter = new PersistableFilter($constructorArg);
     // Test getters/setters that are not implicitly tested by other tests
     self::assertInstanceOf('FilterGroup', $testFilter->getFilterGroup());
     $testFilter->setDisplayName('Some other display name');
     $testFilter->setIsTemplate(1);
     self::assertTrue($testFilter->getIsTemplate());
     self::assertEquals(0, $testFilter->getParentFilterId());
     $testFilter->setParentFilterId(1);
     self::assertEquals(1, $testFilter->getParentFilterId());
     // Test settings
     self::assertFalse($testFilter->hasSettings());
     $testSetting = new EmailFilterSetting('testEmail', 'Test Email', 'Test Email is required');
     $testSetting2 = new EmailFilterSetting('testEmail2', 'Test Email2', 'Test Email2 is required');
     $testSetting2->setIsLocalized(true);
     $testFilter->addSetting($testSetting);
     $testFilter->addSetting($testSetting2);
     self::assertEquals(array('testEmail' => $testSetting, 'testEmail2' => $testSetting2), $testFilter->getSettings());
     self::assertTrue($testFilter->hasSettings());
     self::assertEquals(array('testEmail'), $testFilter->getSettingNames());
     self::assertEquals(array('testEmail2'), $testFilter->getLocalizedSettingNames());
     self::assertTrue($testFilter->hasSetting('testEmail'));
     self::assertEquals($testSetting, $testFilter->getSetting('testEmail'));
     // Test type validation.
     $typeDescriptionFactory = TypeDescriptionFactory::getInstance();
     $inputTypeDescription = 'class::lib.pkp.tests.classes.filter.TestClass1';
     $outputTypeDescription = 'class::lib.pkp.tests.classes.filter.TestClass2';
     self::assertEquals($inputTypeDescription, $testFilter->getInputType()->getTypeDescription());
     self::assertEquals($outputTypeDescription, $testFilter->getOutputType()->getTypeDescription());
 }
开发者ID:PublishingWithoutWalls,项目名称:pkp-lib,代码行数:35,代码来源:PersistableFilterTest.php

示例2: testMods34SchemaSubmissionAdapter

 /**
  * @covers Mods34SchemaSubmissionAdapter
  */
 public function testMods34SchemaSubmissionAdapter()
 {
     // Test constructor.
     $adapter = new Mods34SchemaSubmissionAdapter(PersistableFilter::tempGroup('metadata::plugins.metadata.mods34.schema.Mods34Schema(CITATION)', 'class::lib.pkp.classes.submission.Submission'));
     self::assertEquals(ASSOC_TYPE_CITATION, $adapter->getAssocType());
     self::assertType('Mods34Schema', $adapter->getMetadataSchema());
     self::assertEquals('Submission', $adapter->getDataObjectClass());
     // Instantiate a test description.
     $submissionDescription =& $this->getMods34Description();
     // Instantiate test submission.
     $submission = new Submission();
     $submission->setTitle('previous submission title', 'en_US');
     $submission->setAbstract('previous abstract', 'en_US');
     // Remove the abstract to test whether the injection into existing data works.
     // (The abstract should not be deleted.)
     $submissionDescription->removeStatement('abstract');
     // Test metadata injection (no replace).
     $resultSubmission =& $adapter->injectMetadataIntoDataObject($submissionDescription, $submission, 'lib.pkp.tests.plugins.metadata.mods34.filter.Author');
     $expectedResult = array('cleanTitle' => array('en_US' => 'new submission title', 'de_DE' => 'neuer Titel'), 'title' => array('en_US' => 'new submission title', 'de_DE' => 'neuer Titel'), 'abstract' => array('en_US' => 'previous abstract'), 'sponsor' => array('en_US' => 'Some Sponsor'), 'dateSubmitted' => '2010-07-07', 'language' => 'en', 'pages' => 215, 'coverageGeo' => array('en_US' => 'some geography'), 'mods34:titleInfo/nonSort' => array('en_US' => 'the', 'de_DE' => 'ein'), 'mods34:titleInfo/subTitle' => array('en_US' => 'subtitle', 'de_DE' => 'Subtitel'), 'mods34:titleInfo/partNumber' => array('en_US' => 'part I', 'de_DE' => 'Teil I'), 'mods34:titleInfo/partName' => array('en_US' => 'introduction', 'de_DE' => 'Einführung'), 'mods34:note' => array('en_US' => array('0' => 'some note', '1' => 'another note'), 'de_DE' => array('0' => 'übersetzte Anmerkung')), 'mods34:subject/temporal[@encoding="w3cdtf" @point="start"]' => '1950', 'mods34:subject/temporal[@encoding="w3cdtf" @point="end"]' => '1954');
     self::assertEquals($expectedResult, $resultSubmission->getAllData());
     // Test meta-data extraction.
     $adapter = new Mods34SchemaSubmissionAdapter(PersistableFilter::tempGroup('class::lib.pkp.classes.submission.Submission', 'metadata::plugins.metadata.mods34.schema.Mods34Schema(CITATION)'));
     $extractedDescription =& $adapter->extractMetadataFromDataObject($submission);
     $submissionDescription->removeStatement('recordInfo/recordCreationDate[@encoding="w3cdtf"]');
     self::assertTrue($submissionDescription->addStatement('recordInfo/recordCreationDate[@encoding="w3cdtf"]', date('Y-m-d')));
     self::assertTrue($submissionDescription->addStatement('abstract', $abstract = 'previous abstract'));
     $missingMappings = array('genre[@authority="marcgt"]', 'originInfo/place/placeTerm[@type="text"]', 'originInfo/place/placeTerm[@type="code" @authority="iso3166"]', 'originInfo/publisher', 'originInfo/dateIssued[@keyDate="yes" @encoding="w3cdtf"]', 'originInfo/edition', 'physicalDescription/form[@authority="marcform"]', 'physicalDescription/internetMediaType', 'identifier[@type="isbn"]', 'identifier[@type="doi"]', 'identifier[@type="uri"]', 'location/url[@usage="primary display"]', 'recordInfo/recordIdentifier[@source="pkp"]', 'subject/topic');
     foreach ($missingMappings as $missingMapping) {
         $submissionDescription->removeStatement($missingMapping);
     }
     self::assertEquals($submissionDescription, $extractedDescription);
 }
开发者ID:ramonsodoma,项目名称:pkp-lib,代码行数:35,代码来源:Mods34SchemaSubmissionAdapterTest.inc.php

示例3: testNlm30CitationSchemaCitationAdapter

 /**
  * @covers Nlm30CitationSchemaCitationAdapter
  */
 public function testNlm30CitationSchemaCitationAdapter()
 {
     // Test constructor.
     $adapter = new Nlm30CitationSchemaCitationAdapter(PersistableFilter::tempGroup('metadata::lib.pkp.plugins.metadata.nlm30.schema.Nlm30CitationSchema(CITATION)', 'class::lib.pkp.classes.citation.Citation'));
     self::assertEquals(ASSOC_TYPE_CITATION, $adapter->getAssocType());
     self::assertType('Nlm30CitationSchema', $adapter->getMetadataSchema());
     self::assertEquals('Citation', $adapter->getDataObjectClass());
     // Instantiate a test description.
     $authorDescription = new MetadataDescription('lib.pkp.plugins.metadata.nlm30.schema.Nlm30NameSchema', ASSOC_TYPE_AUTHOR);
     $authorDescription->addStatement('surname', $surname = 'some surname');
     $citationDescription = new MetadataDescription('lib.pkp.plugins.metadata.nlm30.schema.Nlm30CitationSchema', ASSOC_TYPE_CITATION);
     $citationDescription->addStatement('article-title', $articleTitle = 'article title');
     $citationDescription->addStatement('person-group[@person-group-type="author"]', $authorDescription);
     // Instantiate test citation.
     $citation = new Citation();
     // Test metadata injection.
     $resultCitation =& $adapter->injectMetadataIntoDataObject($citationDescription, $citation);
     $expectedResult = array('rawCitation' => '', 'nlm30:person-group[@person-group-type="author"]' => array(array('surname' => 'some surname')), 'nlm30:article-title' => array('en_US' => 'article title'));
     self::assertEquals($expectedResult, $resultCitation->getAllData());
     // Instantiate and inject a second test description.
     $authorDescription = new MetadataDescription('lib.pkp.plugins.metadata.nlm30.schema.Nlm30NameSchema', ASSOC_TYPE_AUTHOR);
     $authorDescription->addStatement('surname', $anotherSurname = 'another surname');
     $secondDescription = new MetadataDescription('lib.pkp.plugins.metadata.nlm30.schema.Nlm30CitationSchema', ASSOC_TYPE_CITATION);
     $secondDescription->addStatement('person-group[@person-group-type="author"]', $authorDescription);
     $secondDescription->addStatement('source', $source = 'some source');
     $resultCitation =& $adapter->injectMetadataIntoDataObject($secondDescription, $citation);
     $expectedResult = array('rawCitation' => '', 'nlm30:person-group[@person-group-type="author"]' => array(array('surname' => 'another surname')), 'nlm30:article-title' => array('en_US' => 'article title'), 'nlm30:source' => array('en_US' => 'some source'));
     self::assertEquals($expectedResult, $resultCitation->getAllData());
     // Test meta-data extraction.
     $adapter = new Nlm30CitationSchemaCitationAdapter(PersistableFilter::tempGroup('class::lib.pkp.classes.citation.Citation', 'metadata::lib.pkp.plugins.metadata.nlm30.schema.Nlm30CitationSchema(CITATION)'));
     $extractedDescription =& $adapter->extractMetadataFromDataObject($resultCitation);
     $secondDescription->addStatement('article-title', $articleTitle = 'article title');
     self::assertEquals($secondDescription, $extractedDescription);
 }
开发者ID:ramonsodoma,项目名称:pkp-lib,代码行数:37,代码来源:Nlm30CitationSchemaCitationAdapterTest.inc.php

示例4: testExecute

 /**
  * @covers PKPSubmissionNlm30XmlFilter
  */
 public function testExecute()
 {
     // Instantiate test meta-data for a citation.
     import('lib.pkp.classes.metadata.MetadataDescription');
     $nameSchemaName = 'lib.pkp.plugins.metadata.nlm30.schema.Nlm30NameSchema';
     $nameDescription = new MetadataDescription($nameSchemaName, ASSOC_TYPE_AUTHOR);
     $nameDescription->addStatement('given-names', $value = 'Peter');
     $nameDescription->addStatement('given-names', $value = 'B');
     $nameDescription->addStatement('surname', $value = 'Bork');
     $nameDescription->addStatement('prefix', $value = 'Mr.');
     $citationSchemaName = 'lib.pkp.plugins.metadata.nlm30.schema.Nlm30CitationSchema';
     $citationDescription = new MetadataDescription($citationSchemaName, ASSOC_TYPE_CITATION);
     $citationDescription->addStatement('person-group[@person-group-type="author"]', $nameDescription);
     $citationDescription->addStatement('article-title', $value = 'PHPUnit in a nutshell', 'en_US');
     $citationDescription->addStatement('date', $value = '2009-08-17');
     $citationDescription->addStatement('size', $value = 320);
     $citationDescription->addStatement('uri', $value = 'http://phpunit.org/nutshell');
     $citationDescription->addStatement('[@publication-type]', $value = 'book');
     $citation =& $this->getCitation($citationDescription);
     // Persist a few copies of the citation for testing.
     $citationDao =& $this->getCitationDao();
     for ($seq = 1; $seq <= 10; $seq++) {
         $citation->setSeq($seq);
         $citation->setCitationState(CITATION_APPROVED);
         $citationId = $citationDao->insertObject($citation);
         self::assertTrue(is_numeric($citationId));
         self::assertTrue($citationId > 0);
     }
     // Execute the filter and check the outcome.
     $mockSubmission =& $this->getTestSubmission();
     // FIXME: Add NLM 3.0 tag set schema validation as soon as we implement the full tag set, see #5648.
     $filter = new PKPSubmissionNlm30XmlFilter(PersistableFilter::tempGroup('class::lib.pkp.classes.submission.Submission', 'xml::*'));
     $nlm30Xml = $filter->execute($mockSubmission);
     self::assertXmlStringEqualsXmlFile('./lib/pkp/tests/plugins/metadata/nlm30/filter/sample-nlm30-citation.xml', $nlm30Xml);
 }
开发者ID:ramonsodoma,项目名称:pkp-lib,代码行数:38,代码来源:PKPSubmissionNlm30XmlFilterTest.inc.php

示例5: testExecuteWithSearch

 /**
  * Test Pubmed lookup without PmID
  * @covers PubmedNlm30CitationSchemaFilter
  */
 public function testExecuteWithSearch()
 {
     // Build the test citations array
     $citationFilterTests = array(array('testInput' => array('person-group[@person-group-type="author"]' => array(array('given-names' => array('Scott', 'D'), 'surname' => 'Halpern'), array('given-names' => array('Peter', 'A'), 'surname' => 'Ubel'), array('given-names' => array('Arthur', 'L'), 'surname' => 'Caplan')), 'article-title' => 'Solid-organ transplantation in HIV-infected patients.', 'source' => 'N Engl J Med', 'volume' => '347', 'issue' => '4'), 'testOutput' => $this->getTestOutput()), array('testInput' => array('person-group[@person-group-type="author"]' => array(array('given-names' => array('Scott', 'D'), 'surname' => 'Halpern'), array('given-names' => array('Peter', 'A'), 'surname' => 'Ubel'), array('given-names' => array('Arthur', 'L'), 'surname' => 'Caplan'))), 'testOutput' => $this->getTestOutput()));
     // Execute the test
     $filter = new PubmedNlm30CitationSchemaFilter(PersistableFilter::tempGroup('metadata::lib.pkp.plugins.metadata.nlm30.schema.Nlm30CitationSchema(CITATION)', 'metadata::lib.pkp.plugins.metadata.nlm30.schema.Nlm30CitationSchema(CITATION)'));
     $this->assertNlm30CitationSchemaFilter($citationFilterTests, $filter);
 }
开发者ID:jprk,项目名称:pkp-lib,代码行数:12,代码来源:PubmedNlm30CitationSchemaFilterTest.php

示例6: MetadataDescriptionDummyAdapter

 /**
  * Constructor
  *
  * @param $metadataDescription MetadataDescription
  */
 function MetadataDescriptionDummyAdapter(&$metadataDescription, $mode = null)
 {
     $this->setDisplayName('Inject/Extract Metadata into/from a MetadataDescription');
     // Configure the adapter
     $inputType = $outputType = 'metadata::' . $metadataDescription->getMetadataSchemaName() . '(*)';
     parent::MetadataDataObjectAdapter(PersistableFilter::tempGroup($inputType, $outputType), $mode);
     $this->_assocType = $metadataDescription->getAssocType();
 }
开发者ID:jprk,项目名称:pkp-lib,代码行数:13,代码来源:MetadataDescriptionDummyAdapter.inc.php

示例7: getCitationOutputFilterInstance

 /**
  * Retrieve the citation output filter that will be
  * used to transform citations.
  * @return TemplateBasedFilter
  */
 function getCitationOutputFilterInstance()
 {
     $citationOutputFilterName = $this->getData('citationOutputFilterName');
     assert(!is_null($citationOutputFilterName));
     list($inputTypeDescription, $outputTypeDescription) = $this->getCitationOutputFilterTypeDescriptions();
     $filterGroup = PersistableFilter::tempGroup($inputTypeDescription, $outputTypeDescription);
     return instantiate($citationOutputFilterName, 'TemplateBasedFilter', null, null, $filterGroup);
 }
开发者ID:PublishingWithoutWalls,项目名称:pkp-lib,代码行数:13,代码来源:TemplateBasedReferencesListFilter.inc.php

示例8: testExecuteWithOpenurl10Search

 /**
  * Test CrossRef lookup without DOI
  * @covers CrossrefNlm30CitationSchemaFilter
  */
 public function testExecuteWithOpenurl10Search()
 {
     // Build the test citations array
     $citationFilterTests = array(array('testInput' => array('person-group[@person-group-type="author"]' => array(array('given-names' => array('Hao'), 'surname' => 'Chen')), 'source' => 'BMC Bioinformatics', 'issue' => '1', 'volume' => '5', 'fpage' => 147, '[@publication-type]' => 'journal'), 'testOutput' => array('source' => 'BMC Bioinformatics', 'issue' => '1', 'volume' => '5', 'date' => '2004', 'fpage' => 147, 'uri' => 'http://www.biomedcentral.com/1471-2105/5/147', 'issn[@pub-type="ppub"]' => '14712105', 'person-group[@person-group-type="author"]' => array(array('given-names' => array('Hao'), 'surname' => 'Chen'), array('given-names' => array('Burt', 'M'), 'surname' => 'Sharp')), 'pub-id[@pub-id-type="doi"]' => '10.1186/1471-2105-5-147', '[@publication-type]' => 'journal')));
     // Execute the test
     $filter = new CrossrefNlm30CitationSchemaFilter(PersistableFilter::tempGroup('metadata::lib.pkp.plugins.metadata.nlm30.schema.Nlm30CitationSchema(CITATION)', 'metadata::lib.pkp.plugins.metadata.nlm30.schema.Nlm30CitationSchema(CITATION)'));
     $filter->setEmail(self::ACCESS_EMAIL);
     $this->assertNlm30CitationSchemaFilter($citationFilterTests, $filter);
 }
开发者ID:jalperin,项目名称:pkp-lib,代码行数:13,代码来源:CrossrefNlm30CitationSchemaFilterTest.php

示例9: testAllCitationsWithThisParser

 /**
  * @covers ParaciteRawCitationNlm30CitationSchemaFilter
  */
 public function testAllCitationsWithThisParser()
 {
     foreach (ParaciteRawCitationNlm30CitationSchemaFilter::getSupportedCitationModules() as $citationModule) {
         $filter = new ParaciteRawCitationNlm30CitationSchemaFilter(PersistableFilter::tempGroup('primitive::string', 'metadata::lib.pkp.plugins.metadata.nlm30.schema.Nlm30CitationSchema(CITATION)'));
         $filter->setData('citationModule', $citationModule);
         parent::_testAllCitationsWithThisParser($filter);
         unset($filter);
     }
 }
开发者ID:PublishingWithoutWalls,项目名称:pkp-lib,代码行数:12,代码来源:ParaciteRawCitationNlm30CitationSchemaFilterTest.php

示例10: toXml

 /**
  * @copydoc OAIMetadataFormat::toXML
  */
 function toXml(&$record, $format = null)
 {
     $publicationFormat =& $record->getData('publicationFormat');
     $description = $publicationFormat->extractMetadata(new Xmdp22Schema());
     $xmlFilter = new Xmdp22DescriptionXmlFilter(PersistableFilter::tempGroup('metadata::plugins.metadata.xmdp22.schema.Xmdp22Schema(*)', 'xml::schema(plugins/metadata/xmdp22/filter/xmdp22.xsd)'));
     //FIXME: Hack to remove the duplicate XML document declarations
     $response = substr($xmlFilter->process($description), 39);
     return $response;
 }
开发者ID:kadowa,项目名称:omp-xmdp-oai-plugin,代码行数:12,代码来源:OAIMetadataFormat_XMDP.inc.php

示例11: testMods34DescriptionXmlFilter

 /**
  * @covers Mods34DescriptionXmlFilter
  */
 public function testMods34DescriptionXmlFilter()
 {
     // Get the test description.
     $submissionDescription = $this->getMods34Description();
     // Instantiate filter.
     $filter = new Mods34DescriptionXmlFilter(PersistableFilter::tempGroup('metadata::plugins.metadata.mods34.schema.Mods34Schema(*)', 'xml::schema(lib/pkp/plugins/metadata/mods34/filter/mods34.xsd)'));
     // Transform MODS description to XML.
     $output = $filter->execute($submissionDescription);
     self::assertXmlStringEqualsXmlFile('./lib/pkp/tests/plugins/metadata/mods34/filter/test.xml', $output);
 }
开发者ID:jalperin,项目名称:pkp-lib,代码行数:13,代码来源:Mods34DescriptionXmlFilterTest.php

示例12: testExecute

 /**
  * @covers IsbndbIsbnNlm30CitationSchemaFilter
  * @covers IsbndbNlm30CitationSchemaFilter
  */
 public function testExecute()
 {
     // Test data
     $isbnLookupTest = array('testInput' => '9780820452425', 'testOutput' => array('source' => array('en_US' => 'After literacy: essays'), 'date' => '2001', 'person-group[@person-group-type="author"]' => array(0 => array('given-names' => array('John'), 'surname' => 'Willinsky')), 'publisher-loc' => 'New York', 'publisher-name' => 'P. Lang', 'isbn' => '9780820452425', '[@publication-type]' => 'book'));
     // Build the test array
     $citationFilterTests = array($isbnLookupTest);
     // Test the filter
     $filter = new IsbndbIsbnNlm30CitationSchemaFilter(PersistableFilter::tempGroup('primitive::string', 'metadata::lib.pkp.plugins.metadata.nlm30.schema.Nlm30CitationSchema(CITATION)'));
     $filter->setData('apiKey', self::ISBNDB_TEST_APIKEY);
     $this->assertNlm30CitationSchemaFilter($citationFilterTests, $filter);
 }
开发者ID:ramonsodoma,项目名称:pkp-lib,代码行数:15,代码来源:IsbndbIsbnNlm30CitationSchemaFilterTest.inc.php

示例13: testExecute

 /**
  * @covers IsbndbNlm30CitationSchemaIsbnFilter
  * @covers IsbndbNlm30CitationSchemaFilter
  */
 public function testExecute()
 {
     // Test data
     $isbnSearchTest = array('testInput' => array('person-group[@person-group-type="author"]' => array(0 => array('given-names' => array('John'), 'surname' => 'Willinsky')), 'source' => array('en_US' => 'After literacy')), 'testOutput' => '9780820452425');
     // Build the test array
     $citationFilterTests = array($isbnSearchTest);
     // Test the filter
     $filter = new IsbndbNlm30CitationSchemaIsbnFilter(PersistableFilter::tempGroup('metadata::lib.pkp.plugins.metadata.nlm30.schema.Nlm30CitationSchema(CITATION)', 'primitive::string'));
     $apiKey = $this->_getIsbndbApiKey();
     if (!$apiKey) {
         $this->markTestSkipped('ISBNDB API key not available.');
     }
     $filter->setData('apiKey', $apiKey);
     $this->assertNlm30CitationSchemaFilter($citationFilterTests, $filter);
 }
开发者ID:mczirfusz,项目名称:pkp-lib,代码行数:19,代码来源:IsbndbNlm30CitationSchemaIsbnFilterTest.php

示例14: testExecuteWithDoi

 /**
  * Test CrossRef lookup with DOI
  * @covers WorldcatNlm30CitationSchemaFilter
  */
 public function testExecuteWithDoi()
 {
     // Test book lookup
     $testWithApiKey = array('testInput' => array('person-group[@person-group-type="author"]' => array(array('given-names' => array('Paula'), 'surname' => 'Fernandes Lopes')), 'source' => 'A ética platônica: modelo de ética da boa vida'), 'testOutput' => array('person-group[@person-group-type="author"]' => array(array('given-names' => array('Paula', 'Fernandes'), 'surname' => 'Lopes')), 'source' => 'A ética platônica : modelo de ética da boa vida', 'isbn' => '851503154X', 'publisher-loc' => 'São Paulo', 'publisher-name' => 'Ed. Loyola', 'date' => '2005'));
     // Build the test citations array
     $citationFilterTests = array($testWithApiKey);
     // Execute the tests with API key
     $filter = new WorldcatNlm30CitationSchemaFilter(PersistableFilter::tempGroup('metadata::lib.pkp.plugins.metadata.nlm30.schema.Nlm30CitationSchema(CITATION)', 'metadata::lib.pkp.plugins.metadata.nlm30.schema.Nlm30CitationSchema(CITATION)'));
     $filter->setData('apiKey', self::WORLDCAT_TEST_APIKEY);
     $this->assertNlm30CitationSchemaFilter($citationFilterTests, $filter);
     // Try again without API key
     $testWithoutApiKey = array('testInput' => array('person-group[@person-group-type="author"]' => array(array('given-names' => array('Paula'), 'surname' => 'Fernandes Lopes')), 'source' => 'A ética platônica: modelo de ética da boa vida'), 'testOutput' => array('person-group[@person-group-type="author"]' => array(array('given-names' => array('Paula', 'Fernandes'), 'surname' => 'Lopes')), 'source' => 'A ética platônica : modelo de ética da boa vida', 'isbn' => '9788515031542', 'date' => '2005', 'publisher-name' => 'Ed. Loyola', 'publisher-loc' => 'São Paulo'));
     $citationFilterTests = array($testWithoutApiKey);
     $filter = new WorldcatNlm30CitationSchemaFilter(PersistableFilter::tempGroup('metadata::lib.pkp.plugins.metadata.nlm30.schema.Nlm30CitationSchema(CITATION)', 'metadata::lib.pkp.plugins.metadata.nlm30.schema.Nlm30CitationSchema(CITATION)'));
     $this->assertNlm30CitationSchemaFilter($citationFilterTests, $filter);
 }
开发者ID:ramonsodoma,项目名称:pkp-lib,代码行数:20,代码来源:WorldcatNlm30CitationSchemaFilterTest.php

示例15: testExecuteWithDoi

 /**
  * Test CrossRef lookup with DOI
  * @covers WorldcatNlm30CitationSchemaFilter
  */
 public function testExecuteWithDoi()
 {
     // Test book lookup
     $testWithApiKey = array('testInput' => array('person-group[@person-group-type="author"]' => array(array('given-names' => array('Paula'), 'surname' => 'Fernandes Lopes')), 'source' => 'A ética platônica: modelo de ética da boa vida'), 'testOutput' => array('person-group[@person-group-type="author"]' => array(array('given-names' => array('Paula', 'Fernandes'), 'surname' => 'Lopes')), 'source' => 'A ética platônica : modelo de ética da boa vida', 'isbn' => '851503154X', 'publisher-loc' => 'São Paulo', 'publisher-name' => 'Ed. Loyola', 'date' => '2005', '[@publication-type]' => NLM30_PUBLICATION_TYPE_BOOK));
     // Build the test citations array
     $citationFilterTests = array($testWithApiKey);
     // Execute the tests with API key
     self::assertEquals(80, strlen(Config::getVar('debug', 'worldcat_apikey')), 'It seems that the WorldCat API key has not been configured.');
     $filter = new WorldcatNlm30CitationSchemaFilter(PersistableFilter::tempGroup('metadata::lib.pkp.plugins.metadata.nlm30.schema.Nlm30CitationSchema(CITATION)', 'metadata::lib.pkp.plugins.metadata.nlm30.schema.Nlm30CitationSchema(CITATION)'));
     $filter->setData('apiKey', Config::getVar('debug', 'worldcat_apikey'));
     $this->assertNlm30CitationSchemaFilter($citationFilterTests, $filter);
     // Try again without API key
     $testWithoutApiKey = array('testInput' => array('person-group[@person-group-type="author"]' => array(array('given-names' => array('Paula'), 'surname' => 'Fernandes Lopes')), 'source' => 'A ética platônica: modelo de ética da boa vida'), 'testOutput' => array('person-group[@person-group-type="author"]' => array(array('given-names' => array('Paula', 'Fernandes'), 'surname' => 'Lopes')), 'source' => 'A ética platônica : modelo de ética da boa vida', 'isbn' => '9788515031542', 'date' => '2005', 'publisher-name' => 'Ed. Loyola', 'publisher-loc' => 'São Paulo', '[@publication-type]' => NLM30_PUBLICATION_TYPE_BOOK));
     $citationFilterTests = array($testWithoutApiKey);
     $filter = new WorldcatNlm30CitationSchemaFilter(PersistableFilter::tempGroup('metadata::lib.pkp.plugins.metadata.nlm30.schema.Nlm30CitationSchema(CITATION)', 'metadata::lib.pkp.plugins.metadata.nlm30.schema.Nlm30CitationSchema(CITATION)'));
     $this->assertNlm30CitationSchemaFilter($citationFilterTests, $filter);
 }
开发者ID:jalperin,项目名称:pkp-lib,代码行数:21,代码来源:WorldcatNlm30CitationSchemaFilterTest.php


注:本文中的PersistableFilter::tempGroup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。