SmartCane/laravel_app/tests/Unit/Models/ProjectMosaicTest.php
Martin Folkerts 1de6dd4edf wip
2024-07-04 21:16:12 +02:00

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'],
];
}
}