/** * verify * - no payments will be processed if all are in the * processed list */ public function testAddPaymentsToPayloadAlreadyProcessed() { $processedPayments = new SplObjectStorage(); $processedPayments->attach($this->_paymentStubs[0]); $this->_payloadStub->expects($this->never())->method('setAmount'); $handler = Mage::getModel('ebayenterprise_paypal/order_create_payment'); $handler->addPaymentsToPayload($this->_orderStub, $this->_paymentContainer, $processedPayments); }
/** * stub out the setter methods for the payload excluding those * specified in the array * @param array $exclude */ protected function _stubPayload($exclude = array()) { $methods = array('setOrderId', 'setTenderType', 'setAccountUniqueId', 'setPanIsToken', 'setCreateTimestamp', 'setAmount', 'setPin'); foreach ($methods as $method) { if (!in_array($method, $exclude)) { $this->_payloadStub->expects($this->once())->method($method)->will($this->returnSelf()); } } }
/** * stub out the setter methods for the payload excluding those * specified in the array * @param array $exclude */ protected function _stubPayload($exclude = []) { $methods = ['setOrderId', 'setTenderType', 'setAccountUniqueId', 'setPanIsToken', 'setPaymentRequestId', 'setCreateTimestamp', 'setAmount', 'setResponseCode', 'setBankAuthorizationCode', 'setCVV2ResponseCode', 'setAVSResponseCode', 'setPhoneResponseCode', 'setNameResponseCode', 'setEmailResponseCode', 'setAmountAuthorized', 'setExpirationDate', 'setExtendedAuthDescription', 'setExtendedAuthReasonCode', 'setStartDate', 'setIssueNumber', 'setAuthenticationAvailable', 'setAuthenticationStatus', 'setCavvUcaf', 'setTransactionId', 'setECI', 'setPayerAuthenticationResponse', 'setPurchasePlanCode', 'setPurchasePlanDescription']; foreach ($methods as $method) { if (!in_array($method, $exclude)) { $this->_payloadStub->expects($this->once())->method($method)->will($this->returnSelf()); } } }