Пример #1
0
 public function testPassBarcodeMessage()
 {
     // Test first before barcode is added
     $this->assertPasses($this->pass, PassValidator::BARCODE_MESSAGE_INVALID);
     $this->pass->setBarcode(new Barcode(Barcode::TYPE_QR, 'message'));
     $this->assertPasses($this->pass, PassValidator::BARCODE_MESSAGE_INVALID);
     $this->pass->setBarcode(new Barcode(Barcode::TYPE_QR, ''));
     $this->assertPasses($this->pass, PassValidator::BARCODE_MESSAGE_INVALID);
     $this->pass->setBarcode(new Barcode('', null));
     $this->assertFails($this->pass, PassValidator::BARCODE_FORMAT_INVALID);
     $this->pass->setBarcode(new Barcode(null, 0));
     $this->assertFails($this->pass, PassValidator::BARCODE_FORMAT_INVALID);
     $this->pass->setBarcode(new Barcode(null, 123));
     $this->assertFails($this->pass, PassValidator::BARCODE_FORMAT_INVALID);
 }