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); }
public function testBadMagicCall() { $payload = Payload::create([]); $e = null; try { $payload->hello(); } catch (Exception $e) { } $this->assertInstanceOf(ErrorException::class, $e); }