/** * @covers OpenBuildings\PayPal\Payment_Adaptive_Simple::action_type */ public function test_action_type() { $payment = Payment::instance('Adaptive_Simple'); $this->assertEquals('PAY', $payment->action_type()); $payment->action_type('CREATE'); $this->assertEquals('CREATE', $payment->action_type()); }
public function setUp() { parent::setUp(); $this->payment = Payment::instance('Adaptive_Simple'); $this->payment->order(array('receiver' => array('email' => '*****@*****.**', 'amount' => 10))); $this->payment->config('fees_payer', Payment_Adaptive_Simple::FEES_PAYER_EACHRECEIVER)->config('email', '*****@*****.**'); }
/** * @covers OpenBuildings\PayPal\Payment_Adaptive::common_fields */ public function test_common_fields() { $this->assertSame(array('requestEnvelope.errorLanguage' => 'en_US', 'requestEnvelope.detailLevel' => 'ReturnAll'), Payment::instance('Adaptive_Simple')->common_fields()); }
/** * @covers OpenBuildings\PayPal\Payment_ExpressCheckout::get_express_checkout_details */ public function test_get_express_checkout_details_require_token() { $payment = Payment::instance('ExpressCheckout'); $this->setExpectedException('OpenBuildings\\PayPal\\Exception', 'You must provide a TOKEN parameter for method "OpenBuildings\\PayPal\\Payment_ExpressCheckout::get_express_checkout_details"'); $payment->get_express_checkout_details(array()); }
public function test_instance_pattern() { $this->assertSame(Payment::instance('ExpressCheckout'), Payment::instance('ExpressCheckout')); }
/** * @dataProvider data_parse_response_exception * @covers OpenBuildings\PayPal\Payment::parse_response */ public function test_parse_response_exception($response_string, $url, $request_data, $exception_message) { $this->setExpectedException('OpenBuildings\\PayPal\\Request_Exception', $exception_message); Payment::parse_response($response_string, $url, $request_data); }