コード例 #1
0
ファイル: Result.php プロジェクト: phwoolcon/payment
 public function __construct(array $data)
 {
     if (!isset($data['error']) && !isset($data['order'])) {
         throw new ResultException(__('Either error or order is required in a payment result'), ResultException::INVALID_RESULT_FORMAT);
     }
     parent::__construct($data);
 }
コード例 #2
0
ファイル: PayloadTest.php プロジェクト: phwoolcon/phwoolcon
 public function testBadMagicCall()
 {
     $payload = Payload::create([]);
     $e = null;
     try {
         $payload->hello();
     } catch (Exception $e) {
     }
     $this->assertInstanceOf(ErrorException::class, $e);
 }