snipe-it/tests/Unit/Transformers/DepreciationReportTransformerTest.php
2025-01-22 10:21:18 -08:00

25 lines
651 B
PHP

<?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);
}
}