invoiceninja/tests/Unit/WithTypeHelpersTest.php
Benjamin Beganović 74b5afba96 Licence update
2021-11-09 19:59:44 +01:00

46 lines
1.0 KiB
PHP

<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace Tests\Unit;
use App\Models\Account;
use App\Models\Company;
use App\Models\Document;
use Tests\TestCase;
class WithTypeHelpersTest extends TestCase
{
public function testIsImageHelper(): void
{
$account = Account::factory()->create();
$company = Company::factory()->create([
'account_id' => $account->id,
]);
/** @var Document */
$document = Document::factory()->create([
'company_id' => $company->id,
'type' => 'jpeg',
]);
$this->assertTrue($document->isImage());
/** @var Document */
$document = Document::factory()->create([
'company_id' => $company->id,
]);
$this->assertFalse($document->isImage());
}
}