public function testNoAnnotationWhenDisabled()
 {
     $semanticData = $this->semanticDataFactory->newEmptySemanticData(DIWikiPage::newFromText('Foo'));
     $instance = new DisplayTitlePropertyAnnotator(new NullPropertyAnnotator($semanticData), 'Bar');
     $instance->canCreateAnnotation(false);
     $instance->addAnnotation();
     $expected = array('propertyCount' => 0);
     $this->semanticDataValidator->assertThatPropertiesAreSet($expected, $instance->getSemanticData());
 }
 /**
  * @since 2.4
  *
  * @param SemanticData $semanticData
  * @param string|false $displayTitle
  * @param string $defaultSort
  *
  * @return DisplayTitlePropertyAnnotator
  */
 public function newDisplayTitlePropertyAnnotator(PropertyAnnotator $propertyAnnotator, $displayTitle, $defaultSort)
 {
     $displayTitlePropertyAnnotator = new DisplayTitlePropertyAnnotator($propertyAnnotator, $displayTitle, $defaultSort);
     $displayTitlePropertyAnnotator->canCreateAnnotation((ApplicationFactory::getInstance()->getSettings()->get('smwgDVFeatures') & SMW_DV_WPV_DTITLE) != 0);
     return $displayTitlePropertyAnnotator;
 }