/**
  * @dataProvider stringValueProvider
  */
 public function testFormat($suserValue, $type, $linker, $expected)
 {
     $referenceValue = new ReferenceValue();
     $referenceValue->setFieldProperties(array($this->dataItemFactory->newDIProperty('Foo'), $this->dataItemFactory->newDIProperty('Date'), $this->dataItemFactory->newDIProperty('URL')));
     $referenceValue->setOption(ReferenceValue::OPT_CONTENT_LANGUAGE, 'en');
     $referenceValue->setOption(ReferenceValue::OPT_USER_LANGUAGE, 'en');
     $referenceValue->setUserValue($suserValue);
     $instance = new ReferenceValueFormatter($referenceValue);
     $this->stringValidator->assertThatStringContains($expected, $instance->format($type, $linker));
 }
 public function testParseValueWithErroredDv()
 {
     $store = $this->getMockBuilder('\\SMW\\Store')->disableOriginalConstructor()->setMethods(array('getRedirectTarget'))->getMockForAbstractClass();
     $store->expects($this->atLeastOnce())->method('getPropertyValues')->will($this->returnValue(array($this->dataItemFactory->newDIBlob('Bar;Foobar'))));
     $store->expects($this->any())->method('getRedirectTarget')->will($this->returnArgument(0));
     $this->testEnvironment->registerObject('Store', $store);
     $instance = new ReferenceValue();
     $instance->setProperty($this->dataItemFactory->newDIProperty('Foo'));
     $instance->setUserValue('Foo;<>Foo');
     $this->assertInstanceOf('\\SMWDIError', $instance->getDataItem());
     $this->assertEquals(array('[2,"smw-datavalue-wikipage-invalid-title","<>Foo"]'), $instance->getErrors());
 }