Transformers for Projects and tasks

This commit is contained in:
David Bomba 2023-11-09 18:08:54 +11:00
parent 3f30965d54
commit c8408bfa36
2 changed files with 18 additions and 1 deletions

View File

@ -839,7 +839,7 @@ class TemplateService
{
return
collect($projects)->map(function ($project) ){
collect($projects)->map(function ($project){
return $this->transformProject($project);

View File

@ -18,6 +18,7 @@ use App\Models\Credit;
use App\Models\Design;
use App\Models\Invoice;
use App\Models\Payment;
use App\Models\Project;
use App\Utils\HtmlEngine;
use Tests\MockAccountData;
use App\Utils\Traits\MakesDates;
@ -180,6 +181,22 @@ class TemplateTest extends TestCase
}
public function testProjectDataParse()
{
$data = [];
$p = Project::factory()->create([
'user_id' => $this->user->id,
'company_id' => $this->company->id,
'client_id' => $this->client->id,
]);
$ts = new TemplateService();
$ts->processData($data['projects'][$p]);
$this->assertNotNull($ts);
}
public function testNegativeDivAttribute()
{
$dom = new \DOMDocument();