mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-01 20:17:35 -04:00 
			
		
		
		
	Number tests for quotes and recurring invoices
This commit is contained in:
		
							parent
							
								
									7173ba2931
								
							
						
					
					
						commit
						b74062b1ca
					
				| @ -86,7 +86,8 @@ class QuoteTest extends TestCase | ||||
| 
 | ||||
|         $quote_update = [ | ||||
|             'status_id' => Quote::STATUS_APPROVED, | ||||
|          //   'client_id' => $this->encodePrimaryKey($quote->client_id),
 | ||||
|             'client_id' => $this->encodePrimaryKey($this->quote->client_id), | ||||
|             'number'    => 'Rando', | ||||
|         ]; | ||||
| 
 | ||||
|         $this->assertNotNull($this->quote); | ||||
| @ -98,6 +99,22 @@ class QuoteTest extends TestCase | ||||
| 
 | ||||
|         $response->assertStatus(200); | ||||
| 
 | ||||
| 
 | ||||
|         $response = $this->withHeaders([ | ||||
|                 'X-API-SECRET' => config('ninja.api_secret'), | ||||
|                 'X-API-TOKEN' => $this->token, | ||||
|             ])->put('/api/v1/quotes/'.$this->encodePrimaryKey($this->quote->id), $quote_update); | ||||
| 
 | ||||
|         $response->assertStatus(200); | ||||
| 
 | ||||
|         $response = $this->withHeaders([ | ||||
|                 'X-API-SECRET' => config('ninja.api_secret'), | ||||
|                 'X-API-TOKEN' => $this->token, | ||||
|             ])->post('/api/v1/quotes/', $quote_update); | ||||
| 
 | ||||
|         $response->assertStatus(302); | ||||
| 
 | ||||
| 
 | ||||
|         $response = $this->withHeaders([ | ||||
|                 'X-API-SECRET' => config('ninja.api_secret'), | ||||
|                 'X-API-TOKEN' => $this->token, | ||||
|  | ||||
| @ -117,6 +117,7 @@ class RecurringInvoiceTest extends TestCase | ||||
|         $RecurringInvoice_update = [ | ||||
|             'status_id' => RecurringInvoice::STATUS_DRAFT, | ||||
|             'client_id' => $this->encodePrimaryKey($RecurringInvoice->client_id), | ||||
|             'number' => 'customnumber' | ||||
|         ]; | ||||
| 
 | ||||
|         $this->assertNotNull($RecurringInvoice); | ||||
| @ -127,6 +128,26 @@ class RecurringInvoiceTest extends TestCase | ||||
|             ])->put('/api/v1/recurring_invoices/'.$this->encodePrimaryKey($RecurringInvoice->id), $RecurringInvoice_update) | ||||
|             ->assertStatus(200); | ||||
| 
 | ||||
|         $arr = $response->json(); | ||||
| 
 | ||||
|         $this->assertEquals('customnumber', $arr['data']['number']); | ||||
| 
 | ||||
| 
 | ||||
|         $response = $this->withHeaders([ | ||||
|                 'X-API-SECRET' => config('ninja.api_secret'), | ||||
|                 'X-API-TOKEN' => $this->token, | ||||
|             ])->put('/api/v1/recurring_invoices/'.$this->encodePrimaryKey($RecurringInvoice->id), $RecurringInvoice_update) | ||||
|             ->assertStatus(200); | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
|         $response = $this->withHeaders([ | ||||
|                 'X-API-SECRET' => config('ninja.api_secret'), | ||||
|                 'X-API-TOKEN' => $this->token, | ||||
|             ])->post('/api/v1/recurring_invoices/', $RecurringInvoice_update) | ||||
|             ->assertStatus(302); | ||||
| 
 | ||||
| 
 | ||||
|         $response = $this->withHeaders([ | ||||
|                 'X-API-SECRET' => config('ninja.api_secret'), | ||||
|                 'X-API-TOKEN' => $this->token, | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user