Ejemplo n.º 1
0
 public function testDeleteCustomerDiscount()
 {
     $this->customers->updateCustomer($this->customerId, $this->customers->updateCustomerRequest()->setCoupon($this->couponId));
     $getResponse = $this->customers->getCustomer($this->customerId);
     $this->assertEquals($this->couponId, $getResponse->getDiscount()->getCoupon()->getId());
     $deleteResponse = $this->discounts->deleteCustomerDiscount($this->customerId);
     $this->assertInstanceOf(Discounts::DELETE_RESPONSE_CLASS, $deleteResponse);
     $this->assertTrue($deleteResponse->getDeleted());
 }
Ejemplo n.º 2
0
 public function testListCustomers()
 {
     $customer1 = $this->customers->createCustomer();
     $customer2 = $this->customers->createCustomer();
     $this->customers->createCustomer();
     $this->customers->createCustomer();
     $request = new ListRequest();
     $request->setLimit(2);
     $list = $this->customers->listCustomers($request);
     $this->assertInstanceOf(Customers::LIST_CUSTOMERS_RESPONSE_CLASS, $list);
     $this->assertEquals(2, sizeof($list->getData()));
     $this->customers->deleteCustomer($customer1->getId());
     $this->customers->deleteCustomer($customer2->getId());
 }
Ejemplo n.º 3
0
 protected function tearDown()
 {
     parent::tearDown();
     $this->customers->deleteCustomer($this->customerId);
 }