Open Journal Systems  3.3.0
vendor/omnipay/paypal/tests/Message/RestCreatePlanRequestTest.php
1 <?php
2 
3 namespace Omnipay\PayPal\Message;
4 
5 use Omnipay\Tests\TestCase;
7 
8 class RestCreatePlanRequestTest extends TestCase
9 {
11  private $request;
12 
13  public function setUp()
14  {
15  $client = $this->getHttpClient();
16  $request = $this->getHttpRequest();
17  $this->request = new RestCreatePlanRequest($client, $request);
18 
19  $this->request->initialize(array(
20  'name' => 'Super Duper Billing Plan',
21  'description' => 'Test Billing Plan',
23  'paymentDefinitions' => array(
24  array(
25  'name' => 'Monthly Payments',
28  'frequency_interval' => 1,
29  'cycles' => 12,
30  'amount' => array(
31  'value' => 10.00,
32  'currency' => 'USD',
33  )
34  )
35  ),
36  'merchantPreferences' => array(
37  'name' => 'asdf',
38  ),
39  ));
40  }
41 
42  public function testGetData()
43  {
44  $data = $this->request->getData();
45  $this->assertEquals('Super Duper Billing Plan', $data['name']);
46  $this->assertEquals(RestGateway::BILLING_PLAN_TYPE_FIXED, $data['type']);
47  $this->assertEquals('Monthly Payments', $data['payment_definitions'][0]['name']);
48  }
49 }
Omnipay\PayPal\RestGateway\BILLING_PLAN_TYPE_FIXED
const BILLING_PLAN_TYPE_FIXED
Definition: lib/vendor/omnipay/paypal/src/RestGateway.php:156
Omnipay\PayPal\RestGateway\PAYMENT_REGULAR
const PAYMENT_REGULAR
Definition: lib/vendor/omnipay/paypal/src/RestGateway.php:167
Omnipay\PayPal\Message\RestCreatePlanRequestTest\testGetData
testGetData()
Definition: vendor/omnipay/paypal/tests/Message/RestCreatePlanRequestTest.php:45
Omnipay\PayPal\Message\RestCreatePlanRequestTest\setUp
setUp()
Definition: vendor/omnipay/paypal/tests/Message/RestCreatePlanRequestTest.php:16
Omnipay\PayPal\RestGateway
Definition: lib/vendor/omnipay/paypal/src/RestGateway.php:152
Omnipay\PayPal\Message\RestCreatePlanRequest
Definition: lib/vendor/omnipay/paypal/src/Message/RestCreatePlanRequest.php:195
Omnipay\PayPal\RestGateway\BILLING_PLAN_FREQUENCY_MONTH
const BILLING_PLAN_FREQUENCY_MONTH
Definition: lib/vendor/omnipay/paypal/src/RestGateway.php:160
Omnipay\PayPal\Message
Definition: lib/vendor/omnipay/paypal/src/Message/AbstractRequest.php:6