1public function test_fields_are_required()
2 {
3 collect(value: ['name','org_number','company','SSN','ZIP_Code','residence','description'])
4 ->each(callback: function($field){
5 $response = $this->post('/api/customer',
6 array_merge( $this->data(), [$field => '']));
7
8 //$this->assertCount(expectedCount: 1, haystack: $customer);
9
10 $response->assertSessionHasErrors($field);
11 $this->assertCount(expectedCount: 0, haystack: Customer::all());
12 });
13 }
14