コード例 #1
0
ファイル: BarcodeTest.php プロジェクト: navassouza/zf2
 public function testInvalidAdapter()
 {
     $barcode = new Barcode('Ean13');
     $this->setExpectedException('Zend\\Validator\\Exception\\InvalidArgumentException', 'does not implement');
     require_once __DIR__ . "/_files/MyBarcode5.php";
     $barcode->setAdapter('MyBarcode5');
 }
コード例 #2
0
ファイル: BarcodeTest.php プロジェクト: heiglandreas/zf2
 public function testInvalidAdapter()
 {
     $barcode = new Barcode('Ean13');
     try {
         require_once __DIR__ . "/_files/MyBarcode5.php";
         $barcode->setAdapter('MyBarcode5');
         $this->fails('Exception expected');
     } catch (\Exception $e) {
         $this->assertContains('does not implement', $e->getMessage());
     }
 }