/** * @dataProvider initHandholdDiagnostic */ public function testHandheldDiagnose(AbstractAppleHandheld $device, Visitor\HandheldDiagnostic $visitor) { $screen = $device->getScreen(); $device->accept($visitor); $visitor->diagnose(); $this->expectOutputRegex('@Screen width: ' . $screen->getWidth() . '@'); $this->expectOutputRegex('@Screen height: ' . $screen->getHeight() . '@'); $this->expectOutputRegex('@Capacity: ' . $device->getCapacity() . 'gb@'); }
/** * @param AbstractAppleHandheld $device */ public function __construct(AbstractAppleHandheld $device) { parent::__construct($device->getScreen(), $device->getColour(), $device->getCapacity(), static::DEFAULT_PRICE); $this->device = $device; }