mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
25 lines
651 B
PHP
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);
|
||
|
}
|
||
|
}
|