mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 02:39:35 -04:00 
			
		
		
		
	Fixes for tests
This commit is contained in:
		
							parent
							
								
									f893a75e9b
								
							
						
					
					
						commit
						12efe721d1
					
				| @ -33,7 +33,7 @@ class EInvoiceController extends BaseController | ||||
|             'companies' => $data = $el->checkCompany($request->getEntity()), | ||||
|             default => $data['passes'] = false, | ||||
|         }; | ||||
| 
 | ||||
| nlog($data); | ||||
|         return response()->json($data, $data['passes'] ? 200 : 400); | ||||
| 
 | ||||
|     } | ||||
|  | ||||
| @ -78,8 +78,8 @@ class ValidateEInvoiceRequest extends Request | ||||
|         $class = Invoice::class; | ||||
| 
 | ||||
|         match ($this->entity) { | ||||
|           'invoice' => $class = Invoice::class, | ||||
|           'client' => $class = Client::class, | ||||
|           'invoices' => $class = Invoice::class, | ||||
|           'clients' => $class = Client::class, | ||||
|           'companies' => $class = Company::class, | ||||
|           default => $class = Invoice::class, | ||||
|         }; | ||||
|  | ||||
| @ -92,8 +92,8 @@ class EntityLevel | ||||
|         $this->init($invoice->client->locale()); | ||||
| 
 | ||||
|         $this->errors['invoice'] = []; | ||||
|         $this->testClientState($invoice->client); | ||||
|         $this->testCompanyState($invoice->client); // uses client level settings which is what we want
 | ||||
|         $this->errors['client'] = $this->testClientState($invoice->client); | ||||
|         $this->errors['company'] = $this->testCompanyState($invoice->client); // uses client level settings which is what we want
 | ||||
| 
 | ||||
|         $p = new Peppol($invoice); | ||||
| 
 | ||||
| @ -106,7 +106,7 @@ class EntityLevel | ||||
| 
 | ||||
|         }; | ||||
| 
 | ||||
|         $this->errors['status'] = count($this->errors['invoice']) == 0 && count($this->errors['client']) == 0 && count($this->errors['company']) == 0; | ||||
|         $this->errors['passes'] = count($this->errors['invoice']) == 0 && count($this->errors['client']) == 0 && count($this->errors['company']) == 0; | ||||
| 
 | ||||
|         return $this->errors; | ||||
| 
 | ||||
|  | ||||
| @ -44,6 +44,9 @@ class EInvoiceValidationTest extends TestCase | ||||
|     public function testEinvoiceValidationEndpointInvoice() | ||||
|     { | ||||
| 
 | ||||
|         $this->company->legal_entity_id = 123432; | ||||
|         $this->company->save(); | ||||
| 
 | ||||
|         $data =[ | ||||
|             'entity' => 'invoices', | ||||
|             'entity_id' => $this->invoice->hashed_id, | ||||
| @ -63,6 +66,9 @@ class EInvoiceValidationTest extends TestCase | ||||
|     public function testEinvoiceValidationEndpoint() | ||||
|     { | ||||
| 
 | ||||
|         $this->company->legal_entity_id = 123432; | ||||
|         $this->company->save(); | ||||
| 
 | ||||
|         $data =[ | ||||
|             'entity' => 'companies', | ||||
|             'entity_id' => $this->company->hashed_id, | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user