SmartCane/laravel_app/tests/Unit/Models/ProjectMosaicTest.php

45 lines
1,014 B
PHP

<?php
namespace Tests\Unit\Models;
use App\Jobs\ProjectDownloadTiffJob;
use App\Jobs\ProjectMosiacGeneratorJob;
use App\Jobs\ProjectReportGeneratorJob;
use App\Models\Project;
use App\Models\ProjectMosaic;
use Illuminate\Bus\PendingBatch;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Bus;
use Mockery;
use Tests\TestCase;
class ProjectMosaicTest extends TestCase
{
use RefreshDatabase;
/**
* @test
* @dataProvider filenameProvider
* */
public function it_should_return_the_correct_attachment_path($endDate,$offset, $expected)
{
$this->assertEquals(
$expected,
ProjectMosaic::getFilenameByPeriod($endDate,$offset)
);
}
public static function filenameProvider(){
return [
[new Carbon('2022-01-01'), 10, 'period_2021-12-22_2022-01-01.tif'],
[new Carbon('2022-10-25'),7, 'period_2022-10-18_2022-10-25.tif'],
];
}
}