Add failing test

This commit is contained in:
Marcus Moore 2025-01-22 10:21:18 -08:00
parent d696ed8a5a
commit da8999f59a
No known key found for this signature in database

View file

@ -0,0 +1,24 @@
<?php
namespace Tests\Unit\Transformers;
use App\Http\Transformers\DepreciationReportTransformer;
use App\Models\Asset;
use App\Models\Depreciation;
use Tests\TestCase;
class DepreciationReportTransformerTest extends TestCase
{
public function testHandlesModelDepreciationMonthsBeingZero()
{
$asset = Asset::factory()->create();
$depreciation = Depreciation::factory()->create(['months' => 0]);
$asset->model->depreciation()->associate($depreciation);
$transformer = new DepreciationReportTransformer;
$result = $transformer->transformAsset($asset);
$this->assertIsArray($result);
}
}