本文整理汇总了PHP中Wikibase\DataModel\Entity\Item::setFingerprint方法的典型用法代码示例。如果您正苦于以下问题:PHP Item::setFingerprint方法的具体用法?PHP Item::setFingerprint怎么用?PHP Item::setFingerprint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Wikibase\DataModel\Entity\Item
的用法示例。
在下文中一共展示了Item::setFingerprint方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: itemProvider
/**
* @return Item[]
*/
public function itemProvider()
{
$fingerprint = new Fingerprint();
$fingerprint->setLabel('en', 'kittens');
$nonEmptyItem = new Item();
$nonEmptyItem->setFingerprint($fingerprint);
return array($this->addStatementsAndSave(new Item()), $this->addStatementsAndSave($nonEmptyItem));
}
示例2: newItem
private function newItem()
{
$item = new Item();
$item->setId(1337);
$item->setFingerprint($this->newFingerprint());
$item->setSiteLinkList($this->newSiteLinks());
$this->addStatements($item);
return $item;
}
示例3: fingerprintCaseToEntityCase
private function fingerprintCaseToEntityCase(array $fingerprintCase, ItemId $id)
{
$fingerprint = reset($fingerprintCase);
$item = new Item($id);
$item->setFingerprint($fingerprint);
$entityCase = $fingerprintCase;
$entityCase[0] = $item;
return $entityCase;
}
开发者ID:Benestar,项目名称:mediawiki-extensions-Wikibase,代码行数:9,代码来源:LabelDescriptionUniquenessValidatorTest.php
示例4: testExecute
/**
* @dataProvider executeProvider
*/
public function testExecute(Fingerprint $inputFingerprint, $subpage, WebRequest $request = null, array $tagMatchers, Fingerprint $expectedFingerprint = null)
{
$inputEntity = new Item();
$inputEntity->setFingerprint($inputFingerprint);
$this->mockRepository->putEntity($inputEntity);
$id = $inputEntity->getId();
$subpage = str_replace('$id', $id->getSerialization(), $subpage);
list($output, $response) = $this->executeSpecialPage($subpage, $request);
$redirect = $response instanceof FauxResponse ? $response->getHeader('Location') : null;
foreach ($tagMatchers as $key => $matcher) {
$this->assertTag($matcher, $output, "Failed to assert output: {$key}");
}
if ($expectedFingerprint !== null) {
// TODO: Look for an error message in $output.
$this->assertNotEmpty($redirect, 'Expected redirect after successful edit');
/** @var Item $actualEntity */
$actualEntity = $this->mockRepository->getEntity($id);
$actualFingerprint = $actualEntity->getFingerprint();
$this->assetFingerprintEquals($expectedFingerprint, $actualFingerprint);
}
}
开发者ID:Benestar,项目名称:mediawiki-extensions-Wikibase,代码行数:24,代码来源:SpecialSetLabelDescriptionAliasesTest.php
示例5: getEntityTermsProvider
public function getEntityTermsProvider()
{
$fingerprint = new Fingerprint();
$fingerprint->setLabel('en', 'kittens!!!:)');
$fingerprint->setDescription('es', 'es un gato!');
$fingerprint->setAliasGroup('en', array('kitten-alias'));
$item = new Item(new ItemId('Q999'));
$item->setFingerprint($fingerprint);
$expectedTerms = array(new TermIndexEntry(array('entityId' => 999, 'entityType' => 'item', 'termText' => 'es un gato!', 'termLanguage' => 'es', 'termType' => 'description')), new TermIndexEntry(array('entityId' => 999, 'entityType' => 'item', 'termText' => 'kittens!!!:)', 'termLanguage' => 'en', 'termType' => 'label')), new TermIndexEntry(array('entityId' => 999, 'entityType' => 'item', 'termText' => 'kitten-alias', 'termLanguage' => 'en', 'termType' => 'alias')));
return array(array($expectedTerms, $item), array(array(), new Item()), array(array(), $this->getMock('Wikibase\\DataModel\\Entity\\EntityDocument')));
}