public function testImportOfRecordValues()
 {
     $this->importedTitles = array('Property:Has record number field', 'Property:Has record page field', 'Property:Has record text field', 'Property:Has record type', 'Property:Has record type for single test', 'RecordDataTypePage', 'RecordDataTypeRegressionTest/WithSubpage', 'RecordDataTypeRegressionTest');
     $this->titleValidator->assertThatTitleIsKnown($this->importedTitles);
     $title = Title::newFromText('RecordDataTypeRegressionTest');
     $expectedCategoryAsWikiValue = array('property' => new DIProperty('_INST'), 'propertyValues' => array('Regression test', 'Data type regression test', 'Record type regression test'));
     $expectedSomeProperties = array('properties' => array(DIProperty::newFromUserLabel('RecordDataTypePage'), DIProperty::newFromUserLabel('BarText'), DIProperty::newFromUserLabel('BooPage'), DIProperty::newFromUserLabel('FooPage'), DIProperty::newFromUserLabel('QyuPage'), new DIProperty('_ASK'), new DIProperty('_MDAT'), new DIProperty('_SKEY'), new DIProperty('_SOBJ'), new DIProperty('_INST')));
     $property = DIProperty::newFromUserLabel('Has record type for single test');
     $valueString = 'ForSingleTestAsPage;ForSingleTestAsText;3333';
     if ($property->findPropertyTypeID() === '_rec') {
         $valueString = 'ForSingleTestAsPage; ForSingleTestAsText; 3333';
     }
     $expectedRecordTypeValuesAsWikiValue = array('subject' => DIWikiPage::newFromTitle($title), 'record' => $property, 'property' => $property, 'propertyValues' => array($valueString, '?; ?; ?'));
     $expectedRecordPageFieldValuesAsWikiValue = array('subject' => DIWikiPage::newFromTitle($title), 'record' => DIProperty::newFromUserLabel('Has record type'), 'property' => DIProperty::newFromUserLabel('Has record page field'), 'propertyValues' => array('FooPage', 'QyuPageOnSubobject', 'QyuPage', 'XeuiPageOnSubobject', 'RecordDataTypePage', 'BooPage'));
     $expectedRecordTextFieldValuesAsWikiValue = array('subject' => DIWikiPage::newFromTitle($title), 'record' => DIProperty::newFromUserLabel('Has record type'), 'property' => DIProperty::newFromUserLabel('Has record text field'), 'propertyValues' => array('BarText', 'ForSingleTestAsText', 'FooText', 'XeuiTextOnSubobject'));
     $expectedRecordNumberFieldValuesAsNumber = array('subject' => DIWikiPage::newFromTitle(Title::newFromText('RecordDataTypeRegressionTest/WithSubpage')), 'record' => DIProperty::newFromUserLabel('Has record type'), 'property' => DIProperty::newFromUserLabel('Has record number field'), 'propertyValues' => array(1111, 9001, 9999, 1009));
     $semanticDataFinder = new ByPageSemanticDataFinder();
     $semanticDataFinder->setTitle($title)->setStore($this->getStore());
     $semanticDataBatches = array($this->getStore()->getSemanticData(DIWikiPage::newFromTitle($title)));
     foreach ($semanticDataBatches as $semanticData) {
         $this->semanticDataValidator->assertThatCategoriesAreSet($expectedCategoryAsWikiValue, $semanticData);
         $this->semanticDataValidator->assertThatPropertiesAreSet($expectedSomeProperties, $semanticData);
         $this->assertThatSemanticDataValuesAreSet($expectedRecordTypeValuesAsWikiValue, $semanticData);
     }
     $this->assertThatRecordValuesAreSet($expectedRecordTypeValuesAsWikiValue);
     $this->assertThatRecordValuesAreSet($expectedRecordPageFieldValuesAsWikiValue);
     $this->assertThatRecordValuesAreSet($expectedRecordTextFieldValuesAsWikiValue);
     $this->assertThatRecordValuesAreSet($expectedRecordNumberFieldValuesAsNumber);
 }
 public function testImportToVerifyAnnotationByTemplateInclusion()
 {
     $this->importedTitles = array('Foo-1-19-7', 'Template:FooAsk', 'Template:FooShow', 'Template:FooSubobject', 'Template:FooTemplate');
     $this->titleValidator->assertThatTitleIsKnown($this->importedTitles);
     $expectedProperties = array('properties' => array(DIProperty::newFromUserLabel('Foo'), DIProperty::newFromUserLabel('Quux'), new DIProperty('_ASK'), new DIProperty('_MDAT'), new DIProperty('_SKEY'), new DIProperty('_SOBJ'), new DIProperty('_INST')));
     $title = Title::newFromText('Foo-1-19-7');
     $semanticDataFinder = new ByPageSemanticDataFinder();
     $semanticDataFinder->setTitle($title)->setStore($this->getStore());
     $this->semanticDataValidator->assertThatPropertiesAreSet($expectedProperties, $semanticDataFinder->fetchFromOutput());
 }
 public function testCategoryHierarchies()
 {
     $this->importedTitles = array('Category:Regression test', 'Category:Regression test category', 'Category:Regression test sub category', 'Category:Regression test sub sub category', 'CategoryInstanceAndCategoryHierarchyRegressionTest/WithSubpage', 'CategoryInstanceAndCategoryHierarchyRegressionTest/WithSubpage/WithSubSubpage', 'CategoryInstanceAndCategoryHierarchyRegressionTest');
     $this->titleValidator->assertThatTitleIsKnown($this->importedTitles);
     $title = Title::newFromText('CategoryInstanceAndCategoryHierarchyRegressionTest');
     $expectedCategoryAsWikiValue = array('property' => new DIProperty('_INST'), 'propertyValues' => array('Regression test', 'Regression test category', 'Regression test sub category', 'Regression test sub sub category', 'Category regression test'));
     $semanticDataFinder = new ByPageSemanticDataFinder();
     $semanticDataFinder->setTitle($title)->setStore($this->getStore());
     $semanticDataBatches = array($semanticDataFinder->fetchFromOutput(), $semanticDataFinder->fetchFromStore());
     foreach ($semanticDataBatches as $semanticData) {
         $this->semanticDataValidator->assertThatCategoriesAreSet($expectedCategoryAsWikiValue, $semanticData);
     }
 }