Files
InvoiceShelf/tests/Unit/CustomFieldValueTest.php
Darko Gjorgjijoski 6b80b5f48d Change namespace
2024-01-27 23:53:20 +01:00

22 lines
666 B
PHP

<?php
use InvoiceShelf\Models\CustomFieldValue;
use Illuminate\Support\Facades\Artisan;
beforeEach(function () {
Artisan::call('db:seed', ['--class' => 'DatabaseSeeder', '--force' => true]);
Artisan::call('db:seed', ['--class' => 'DemoSeeder', '--force' => true]);
});
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());
});