mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 12:11:08 -04:00
v5.0.0 update
This commit is contained in:
@ -1,32 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Crater\Models\CustomFieldValue;
|
||||
use Crater\Models\User;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
|
||||
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->company_id,
|
||||
]);
|
||||
Sanctum::actingAs(
|
||||
$user,
|
||||
['*']
|
||||
);
|
||||
});
|
||||
|
||||
test('custom field value belongs to company', function () {
|
||||
$fieldValue = CustomFieldValue::factory()->create();
|
||||
|
||||
$this->assertTrue($fieldValue->company()->exists());
|
||||
});
|
||||
|
||||
test('custom field value belongs to custom field', function () {
|
||||
$fieldValue = CustomFieldValue::factory()->forCustomField()->create();
|
||||
|
||||
$this->assertTrue($fieldValue->customField()->exists());
|
||||
});
|
||||
Reference in New Issue
Block a user