File manager - Edit - /var/www/html/homologBancodetalentos/tests/Unit/TalentBank/JobApplicantsCsvExporterTest.php
Back
<?php namespace Tests\Unit\TalentBank; use App\Models\TalentBank\Candidate; use App\Models\TalentBank\Candidate\Experience; use App\Models\TalentBank\Candidate\Skill; use App\Support\TalentBank\JobApplicantsCsvExporter; use App\Support\TalentBank\JobApplicationStatus; use Illuminate\Support\Collection; use Tests\TestCase; class JobApplicantsCsvExporterTest extends TestCase { public function test_row_includes_formatted_profile_sections(): void { $candidate = new Candidate([ 'name' => 'Maria Export Test', 'cpf' => '12345678901', 'email' => 'maria@example.com', 'cellphone' => '21999990000', 'cv_summary' => "Resumo\ncom quebra", 'min_payment' => 2500, 'desired_payment' => 4000, 'has_experience' => true, 'special_needs' => false, ]); $candidate->setRelation('pivot', (object) [ 'status' => JobApplicationStatus::PENDING, 'created_at' => '2026-05-10 14:30:00', ]); $experience = new Experience([ 'company' => 'Tech Park', 'description' => 'Atuacao em projetos web', 'is_current' => true, 'date_start' => '2024-01-01', ]); $experience->setRelation('occupation', (object) ['name' => 'Desenvolvedora']); $experience->setRelation('businessLine', (object) ['name' => 'Tecnologia']); $candidate->setRelation('experiences', collect([$experience])); $candidate->setRelation('educations', collect()); $candidate->setRelation('courses', collect()); $candidate->setRelation('languages', collect()); $candidate->setRelation('wantedOccupations', collect([(object) ['name' => 'TI']])); $candidate->setRelation('skills', collect([ new Skill(['name' => 'PHP']), new Skill(['name' => 'Laravel']), ])); $row = JobApplicantsCsvExporter::row($candidate, collect()); $this->assertSame('Maria Export Test', $row[0]); $this->assertSame('123.456.789-01', $row[1]); $this->assertStringContainsString('Desenvolvedora @ Tech Park (Tecnologia)', $row[18]); $this->assertStringContainsString('Atuacao em projetos web', $row[18]); $this->assertSame('PHP, Laravel', $row[22]); $this->assertSame('Resumo com quebra', $row[23]); $this->assertSame('10/05/2026 14:30', $row[24]); $this->assertSame('Em anĂ¡lise', $row[25]); } public function test_headers_match_row_column_count(): void { $candidate = new Candidate(['name' => 'Teste']); $candidate->setRelation('experiences', collect()); $candidate->setRelation('educations', collect()); $candidate->setRelation('courses', collect()); $candidate->setRelation('languages', collect()); $candidate->setRelation('wantedOccupations', collect()); $candidate->setRelation('skills', collect()); $candidate->setRelation('pivot', (object) ['status' => JobApplicationStatus::ENROLLED]); $this->assertCount( count(JobApplicantsCsvExporter::headers()), JobApplicantsCsvExporter::row($candidate, collect()) ); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings