/** * @dataProvider conversionDataProvider */ public function testFetchConversionData($thousands, $decimal, $correspondsTo, $unitIds, $unitFactors, $mainUnit, $prefixalUnitPreference) { $cachedPropertyValuesPrefetcher = $this->getMockBuilder('\\SMW\\CachedPropertyValuesPrefetcher')->disableOriginalConstructor()->getMock(); $cachedPropertyValuesPrefetcher->expects($this->once())->method('getPropertyValues')->will($this->returnValue(array($this->dataItemFactory->newDIBlob($correspondsTo)))); $numberValue = new NumberValue(); $numberValue->setOption('separator.thousands', $thousands); $numberValue->setOption('separator.decimal', $decimal); $instance = new UnitConversionFetcher($numberValue, $cachedPropertyValuesPrefetcher); $instance->fetchConversionData($this->dataItemFactory->newDIProperty('Foo')); $this->assertEmpty($instance->getErrors()); $this->assertEquals($unitIds, $instance->getUnitIds()); $this->assertEquals($unitFactors, $instance->getUnitFactors()); $this->assertEquals($mainUnit, $instance->getMainUnit()); $this->assertEquals($prefixalUnitPreference, $instance->getPrefixalUnitPreference()); }