private function getSerialized(QuantityQuery $query) { $text = 'quantity[' . $query->getPropertyId()->getNumericId() . ','; if ($query->getLowerValue() !== null) { $text .= $query->getLowerValue()->getValue(); } if ($query->getUpperValue() !== null) { $text .= ',' . $query->getUpperValue()->getValue(); } return $text . ']'; }
public function testGetUpperValue() { $query = new QuantityQuery(new PropertyId('P42'), new DecimalValue('+41'), new DecimalValue('+43')); $this->assertEquals(new DecimalValue('+43'), $query->getUpperValue()); }