Ejemplo n.º 1
0
 /**
  * Get all customers.
  *
  * @param string $page
  *
  * @throws \Exception|mixed
  *
  * @return \Exception|mixed
  */
 public function getCustomers($page = '')
 {
     $customerObjects = [];
     $customers = $this->getCustomerResource()->getAll($page);
     if ($customers instanceof \Exception) {
         throw $customers;
     }
     foreach ($customers as $customer) {
         $customerObject = new Customer($this->getCustomerResource());
         $customerObjects[] = $customerObject->_setAttributes($customer);
     }
     return $customerObjects;
 }
Ejemplo n.º 2
0
 public function testAttemptToSaveEmptyDataThrowsException()
 {
     $this->setExpectedException(\InvalidArgumentException::class);
     $customerModel = new Customer($this->customerResource);
     $customerModel->save();
 }