44 lines
980 B
PHP
44 lines
980 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'), 7, 'week_52_2021.tif'],
|
|
[new Carbon('2022-10-25'),7, 'week_43_2022.tif'],
|
|
];
|
|
|
|
}
|
|
}
|