add phone number, notes, and contact person to carrier
This commit is contained in:
parent
f37868f0d0
commit
a739479e22
9 changed files with 88 additions and 6 deletions
|
|
@ -13,12 +13,24 @@ class CreateCarrierTest extends TestCase
|
|||
{
|
||||
$email = 'joe@shmoe.com';
|
||||
$company = 'test company';
|
||||
$contactPerson = 'Joe Shmoe';
|
||||
$phoneNumber = '132456798';
|
||||
$notes = 'some notes';
|
||||
$carrierRepo = new FakeCarrierRepository();
|
||||
$dto = new CreateCarrierRequest($email, $company);
|
||||
$dto = new CreateCarrierRequest(
|
||||
$email,
|
||||
$company,
|
||||
$contactPerson,
|
||||
$phoneNumber,
|
||||
$notes,
|
||||
);
|
||||
$useCase = new CreateCarrier($dto, $carrierRepo);
|
||||
$response = $useCase->execute();
|
||||
$foundCarrier = $carrierRepo->find($response->getId());
|
||||
$this->assertEquals($email, $foundCarrier->getEmail());
|
||||
$this->assertEquals($company, $foundCarrier->getCompanyName());
|
||||
$this->assertEquals($contactPerson, $foundCarrier->getContactPerson());
|
||||
$this->assertEquals($phoneNumber, $foundCarrier->getPhoneNumber());
|
||||
$this->assertEquals($notes, $foundCarrier->getNotes());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,12 +11,31 @@ class GetAllCarriersTest extends TestCase
|
|||
{
|
||||
public function test_get_one_carrier(): void
|
||||
{
|
||||
$email = 'email@email.com';
|
||||
$company = 'test Company';
|
||||
$contactPerson = 'joe shmoe';
|
||||
$phoneNumber = '123456798';
|
||||
$notes = 'some notes';
|
||||
$repo = new FakeCarrierRepository();
|
||||
$repo->save(new Carrier(0, 'email@email.com', 'test Company'));
|
||||
$repo->save(new Carrier(
|
||||
0,
|
||||
$email,
|
||||
$company,
|
||||
$contactPerson,
|
||||
$phoneNumber,
|
||||
$notes,
|
||||
));
|
||||
$useCase = new GetAllCarriers($repo);
|
||||
$response = $useCase->execute();
|
||||
$this->assertEquals(
|
||||
[new Carrier(0, 'email@email.com', 'test Company')],
|
||||
[new Carrier(
|
||||
0,
|
||||
$email,
|
||||
$company,
|
||||
$contactPerson,
|
||||
$phoneNumber,
|
||||
$notes,
|
||||
)],
|
||||
$response
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue