/** * set a customer to be billed * * @param $customer * @return bool */ public function addCustomer($customer) { $model = new Customer($customer); if ($model->validate()) { $this->customer = $customer; return true; } $this->errors = $model->errors; return false; }
/** * test whether shipping is created with given values */ public function testCreate() { $model = new Customer(['name' => 'Gorbadoc Oldbuck', 'cpf' => '04267484171', 'phone_number' => '5144916523', 'email' => '*****@*****.**', 'birth' => '1977-01-15']); $this->assertTrue($model->validate()); }