/** * 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; }
public function testAttemptToSaveEmptyDataThrowsException() { $this->setExpectedException(\InvalidArgumentException::class); $customerModel = new Customer($this->customerResource); $customerModel->save(); }