/** * @test * * @expectedException \Payum\Exception\LogicException * @expectedExceptionMessage Cannot find right api supported by */ public function throwIfPaymentNotHaveApiSupportedByAction() { $payment = new Payment(); $payment->addApi($firstApi = new \stdClass()); $payment->addApi($secondApi = new \stdClass()); $action = $this->getMockForAbstractClass('Payum\\Tests\\ApiAwareAction'); $action->expects($this->at(0))->method('setApi')->with($this->identicalTo($firstApi))->will($this->throwException(new UnsupportedApiException('first api not supported'))); $action->expects($this->at(1))->method('setApi')->with($this->identicalTo($secondApi))->will($this->throwException(new UnsupportedApiException('second api not supported'))); $payment->addAction($action); }