/
home
/
alixis5
/
integrate.sellofinance.com
/
tests
/
Unit
/
Models
/
/home/alixis5/integrate.sellofinance.com/tests/Unit/Models
mkdir
upload
Name
Size
Mode
Actions
CustomerEmploymentTest.php
1967
0644
edit
dl
rm
Edit:
/home/alixis5/integrate.sellofinance.com/tests/Unit/Models/CustomerEmploymentTest.php
(1967B)
<?php declare(strict_types=1); namespace Sello\Tests\Unit\Models; use PHPUnit\Framework\TestCase; use Sello\Models\CustomerEmployment; class CustomerEmploymentTest extends TestCase { private array $espoPayload = [ 'id' => 'emp-001', 'createdAt' => '2026-04-09T10:00:00Z', 'modifiedAt' => '2026-04-09T10:00:00Z', 'customerProfileId' => 'prof-001', 'employmentType' => 'privateSector', 'employerName' => 'ADNOC', 'jobTitle' => 'Engineer', 'salaryTransfer' => true, 'employerCategory' => 'listed', 'workSinceDate' => '2018-01-01', 'employerCountry' => 'AE', 'employmentStatus' => 'active', ]; public function test_from_espo_maps_all_fields(): void { $model = CustomerEmployment::fromEspo($this->espoPayload); $this->assertSame('emp-001', $model->id); $this->assertSame('prof-001', $model->customerProfileId); $this->assertSame('privateSector', $model->employmentType); $this->assertSame('ADNOC', $model->employerName); $this->assertSame('Engineer', $model->jobTitle); $this->assertTrue($model->salaryTransfer); $this->assertSame('listed', $model->employerCategory); $this->assertSame('2018-01-01', $model->workSinceDate); $this->assertSame('AE', $model->employerCountry); $this->assertSame('active', $model->employmentStatus); } public function test_optional_fields_default_to_null(): void { $model = CustomerEmployment::fromEspo([ 'id' => 'emp-002', 'createdAt' => '', 'modifiedAt' => '', 'customerProfileId' => 'prof-001', ]); $this->assertNull($model->employmentType); $this->assertNull($model->employerName); $this->assertFalse($model->salaryTransfer); } }
Save
cmd:
run