/** * @dataProvider initHandholdSpecifcation */ public function testHandheldSpecification(AbstractAppleHandheld $device, Visitor\HandheldSpecification $visitor) { $screen = $device->getScreen(); $device->accept($visitor); $specification = $visitor->getSpecification(); $this->assertRegExp('/Colour is: ' . $device->getColour() . '/', $specification); $this->assertRegExp('/Price is: ' . $device->getPrice() . '/', $specification); $this->assertRegExp('/Screen dimensions: ' . $screen->getHeight() . 'x' . $screen->getWidth() . '/', $specification); $this->assertRegExp('/Device Capacity: ' . $device->getCapacity() . 'gb/', $specification); }
/** * * @return float */ public function getPrice() { return $this->device->getPrice() + $this->price; }