private function initPropertyChain($value) { $chain = explode('.', $value); // Get the last which represents the final output // Foo.Bar.Foobar.Baz $last = array_pop($chain); $this->lastPropertyChainValue = PropertyValue::makeUserProperty($last); if (!$this->lastPropertyChainValue->isValid()) { return $this->addError($this->lastPropertyChainValue->getErrors()); } $this->lastPropertyChainValue->setOptions($this->getOptions()); // Generate a forward list from the remaining property labels // Foo.Bar.Foobar foreach ($chain as $value) { $propertyValue = PropertyValue::makeUserProperty($value); if (!$propertyValue->isValid()) { continue; } $propertyValue->setOptions($this->getOptions()); $this->propertyValues[] = $propertyValue; } }
/** * @dataProvider optionsProvider */ public function testOptions($options, $expected) { $instance = new PropertyValue('__pro'); $instance->setOptions(new Options(array('smwgDVFeatures' => $options))); $this->assertEquals($expected, $instance->getOptionBy('smwgDVFeatures')); }