add load profile and countries serving to carrier
This commit is contained in:
parent
cce5e296c6
commit
3be8eee948
6 changed files with 37 additions and 0 deletions
|
|
@ -7,6 +7,9 @@ use FreightQuote\Carrier\CarrierRepository;
|
|||
|
||||
class FakeCarrierRepository implements CarrierRepository
|
||||
{
|
||||
/**
|
||||
* @var Carrier[]
|
||||
*/
|
||||
private array $existingCarriers = [];
|
||||
|
||||
public function find(int $id): ?Carrier
|
||||
|
|
@ -20,6 +23,8 @@ class FakeCarrierRepository implements CarrierRepository
|
|||
$carrier->getContactPerson(),
|
||||
$carrier->getPhoneNumber(),
|
||||
$carrier->getNotes(),
|
||||
$carrier->getLoadProfile(),
|
||||
$carrier->getCountriesServing(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -43,6 +48,8 @@ class FakeCarrierRepository implements CarrierRepository
|
|||
$carrier->getContactPerson(),
|
||||
$carrier->getPhoneNumber(),
|
||||
$carrier->getNotes(),
|
||||
$carrier->getLoadProfile(),
|
||||
$carrier->getCountriesServing(),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -61,6 +68,8 @@ class FakeCarrierRepository implements CarrierRepository
|
|||
$carrier->getContactPerson(),
|
||||
$carrier->getPhoneNumber(),
|
||||
$carrier->getNotes(),
|
||||
$carrier->getLoadProfile(),
|
||||
$carrier->getCountriesServing(),
|
||||
);
|
||||
}, $this->existingCarriers);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ class CreateCarrierTest extends TestCase
|
|||
$contactPerson = 'Joe Shmoe';
|
||||
$phoneNumber = '132456798';
|
||||
$notes = 'some notes';
|
||||
$loadProfile = 'LTL/FTL'; // Less than full trailer load and full trailer load
|
||||
$countriesServing = ['USA', 'FRA', 'UK'];
|
||||
$carrierRepo = new FakeCarrierRepository();
|
||||
$dto = new CreateCarrierRequest(
|
||||
$email,
|
||||
|
|
@ -23,6 +25,8 @@ class CreateCarrierTest extends TestCase
|
|||
$contactPerson,
|
||||
$phoneNumber,
|
||||
$notes,
|
||||
$loadProfile,
|
||||
$countriesServing,
|
||||
);
|
||||
$useCase = new CreateCarrier($dto, $carrierRepo);
|
||||
$response = $useCase->execute();
|
||||
|
|
@ -32,5 +36,7 @@ class CreateCarrierTest extends TestCase
|
|||
$this->assertEquals($contactPerson, $foundCarrier->getContactPerson());
|
||||
$this->assertEquals($phoneNumber, $foundCarrier->getPhoneNumber());
|
||||
$this->assertEquals($notes, $foundCarrier->getNotes());
|
||||
$this->assertEquals($loadProfile, $foundCarrier->getLoadProfile());
|
||||
$this->assertEquals($countriesServing, $foundCarrier->getCountriesServing());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ class GetAllCarriersTest extends TestCase
|
|||
$contactPerson = 'joe shmoe';
|
||||
$phoneNumber = '123456798';
|
||||
$notes = 'some notes';
|
||||
$loadProfile = 'LTL/FTL';
|
||||
$countriesServing = ['USA', 'FRA', 'UK'];
|
||||
$repo = new FakeCarrierRepository();
|
||||
$repo->save(new Carrier(
|
||||
0,
|
||||
|
|
@ -24,6 +26,8 @@ class GetAllCarriersTest extends TestCase
|
|||
$contactPerson,
|
||||
$phoneNumber,
|
||||
$notes,
|
||||
$loadProfile,
|
||||
$countriesServing,
|
||||
));
|
||||
$useCase = new GetAllCarriers($repo);
|
||||
$response = $useCase->execute();
|
||||
|
|
@ -35,6 +39,8 @@ class GetAllCarriersTest extends TestCase
|
|||
$contactPerson,
|
||||
$phoneNumber,
|
||||
$notes,
|
||||
$loadProfile,
|
||||
$countriesServing,
|
||||
)],
|
||||
$response
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue