test get bid and throws error on invalid id
This commit is contained in:
parent
b17f6005b7
commit
bc6e3e47fe
4 changed files with 59 additions and 0 deletions
22
tests/Unit/Bid/UseCases/GetBidForCarrierTest.php
Normal file
22
tests/Unit/Bid/UseCases/GetBidForCarrierTest.php
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Unit\Bid\UseCases;
|
||||
|
||||
use FreightQuote\Bid\UseCases\GetBidForCarrier;
|
||||
use FreightQuote\Bid\UseCases\GetBidForCarrierRequest;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use InvalidArgumentException;
|
||||
use Tests\Fakes\Bid\FakeBidRepository;
|
||||
|
||||
class GetBidForCarrierTest extends TestCase
|
||||
{
|
||||
public function test_nonexistant_bid_throws_error(): void
|
||||
{
|
||||
$this->expectException(InvalidArgumentException::class);
|
||||
$bidId = '12345abcd';
|
||||
$dto = new GetBidForCarrierRequest($bidId);
|
||||
$bidRepo = new FakeBidRepository();
|
||||
$useCase = new GetBidForCarrier($bidRepo);
|
||||
$foundBid = $useCase->execute($dto);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue