Initial commit

This commit is contained in:
Omair Saleh
2023-01-16 16:33:39 +08:00
commit 9207a3971d
161 changed files with 18844 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
<?php
namespace Tests\Support;
use Illuminate\Foundation\Testing\WithFaker;
use Src\Services\Project\Application\Mappers\ProjectMapper;
use Src\Services\Project\Domain\Factories\ProjectFactory;
use Src\Services\Project\Domain\Models\Project;
trait WithProjects
{
use WithFaker;
public function newProject(): Project
{
$project = ProjectFactory::new();
$projectEloquentModel = ProjectMapper::toEloquent($project);
$projectEloquentModel->save();
return ProjectMapper::fromEloquent($projectEloquentModel);
}
public function createRandomProjects(int $projectsCount) : void
{
foreach (range(1, $projectsCount) as $_) {
$this->newProject();
}
}
}