/** * @test */ public function shouldCreateWithActionAndObjectRequest() { $action = $this->getMock('Payum\\Action\\ActionInterface', array(), array(), 'Mock_Action24'); $exception = RequestNotSupportedException::createActionNotSupported($action, new \stdClass()); $this->assertInstanceOf('Payum\\Exception\\RequestNotSupportedException', $exception); $this->assertEquals('Action Mock_Action24 is not supported the request stdClass.', $exception->getMessage()); }
/** * {@inheritDoc} */ public function execute($request) { /** @var $request ModelRequestInterface */ if (false == $this->supports($request)) { throw RequestNotSupportedException::createActionNotSupported($this, $request); } $request->setModel($request->getModel()->getDetails()); $this->payment->execute($request); }