test get bid link
This commit is contained in:
parent
2d8bca1a07
commit
baab481401
2 changed files with 28 additions and 0 deletions
|
|
@ -29,4 +29,13 @@ class Bid
|
||||||
{
|
{
|
||||||
return $this->carrierId;
|
return $this->carrierId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getBidLink(): ?string
|
||||||
|
{
|
||||||
|
$id = $this->id;
|
||||||
|
if ($id === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return "https://freightquotes.com/bid/$id";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
19
tests/Unit/Bid/BidTest.php
Normal file
19
tests/Unit/Bid/BidTest.php
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\Unit\Bid;
|
||||||
|
|
||||||
|
use FreightQuote\Bid\Bid;
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
|
class BidTest extends TestCase
|
||||||
|
{
|
||||||
|
public function test_bid_link_generated(): void
|
||||||
|
{
|
||||||
|
$bidId = '124e56abf82';
|
||||||
|
$bid = new Bid($bidId, 0, 0);
|
||||||
|
$this->assertEquals(
|
||||||
|
"https://freightquotes.com/bid/$bidId",
|
||||||
|
$bid->getBidLink()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue