/** * @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); }
/** * @param AbstractAppleHandheld $device */ public function __construct(AbstractAppleHandheld $device) { parent::__construct($device->getScreen(), $device->getColour(), $device->getCapacity(), static::DEFAULT_PRICE); $this->device = $device; }