/** * Diagnose the screen * * @return $this */ protected function diagnoseScreen() { $screen = $this->handheld->getScreen(); echo 'Running diagnostic on screen' . PHP_EOL; echo 'Screen width: ' . $screen->getWidth() . PHP_EOL; echo 'Screen height: ' . $screen->getHeight() . PHP_EOL; return $this; }
/** * @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@'); }
/** * * @return float */ public function getPrice() { return $this->device->getPrice() + $this->price; }