/** * @since 1.9 * * @return DataValue * @throws OutOfBoundsException */ public function DataValue() { if (!$this->builder->hasValue('DataValueType')) { throw new OutOfBoundsException('DataValueType is missing'); } $dataValue = $this->getMockBuilder($this->builder->setValue('DataValueType'))->disableOriginalConstructor()->getMock(); foreach ($this->builder->getInvokedMethods() as $method) { $dataValue->expects($this->any())->method($method)->will($this->builder->setCallback($method)); } return $dataValue; }