示例#1
0
 /**
  * @coversNothing
  */
 public function testIntegration()
 {
     $purchaseItem = PurchaseItem::find(1);
     $order = Purchase::find(1);
     $purchase = StorePurchase::find(1);
     $this->assertSame($order, $purchaseItem->getPurchase());
     $this->assertSame($purchase, $purchaseItem->getStorePurchase());
 }
示例#2
0
 /**
  * @coversNothing
  */
 public function testIntegration()
 {
     $address = Address::find(1);
     $purchase = Purchase::find(1);
     $country = Country::find(1);
     $city = City::find(2);
     $this->assertSame($purchase, $address->getPurchase());
     $this->assertSame($city, $address->getCity());
     $this->assertSame($country, $address->getCountry());
 }
示例#3
0
 /**
  * @covers ::getRequestParameters
  */
 public function testGetRequestParameters()
 {
     $purchase = Purchase::find(1);
     $data = $purchase->getRequestParameters(array());
     $expected = array('amount' => 100.0, 'currency' => 'GBP', 'transactionReference' => 1, 'items' => [0 => ['name' => 1, 'description' => 'Items from Store 1', 'price' => 60.0, 'quantity' => 1], 1 => ['name' => 2, 'description' => 'Items from Store 1', 'price' => 40.0, 'quantity' => 1]], 'card' => ['firstName' => 'John', 'lastName' => 'Doe', 'address1' => 'Moskovska', 'address2' => '132', 'city' => 'Sofia', 'country' => 'BG', 'postcode' => '1000', 'phone' => '123123', 'email' => '*****@*****.**']);
     $this->assertSame($expected, $data);
 }