mirror of
				https://github.com/crater-invoice/crater.git
				synced 2025-10-28 12:11:08 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			588 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			588 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| use Crater\Models\User;
 | |
| use Illuminate\Support\Facades\Artisan;
 | |
| use Laravel\Sanctum\Sanctum;
 | |
| use function Pest\Laravel\getJson;
 | |
| 
 | |
| beforeEach(function () {
 | |
|     Artisan::call('db:seed', ['--class' => 'DatabaseSeeder', '--force' => true]);
 | |
|     Artisan::call('db:seed', ['--class' => 'DemoSeeder', '--force' => true]);
 | |
| 
 | |
|     $user = User::find(1);
 | |
|     $this->withHeaders([
 | |
|         'company' => $user->companies()->first()->id,
 | |
|     ]);
 | |
|     Sanctum::actingAs(
 | |
|         $user,
 | |
|         ['*']
 | |
|     );
 | |
| });
 | |
| 
 | |
| getJson('api/v1/dashboard')->assertOk();
 | |
| 
 | |
| getJson('api/v1/search?name=ab')->assertOk();
 |