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