test get bid link

This commit is contained in:
Yisroel Baum 2025-11-18 09:50:29 +02:00
parent 2d8bca1a07
commit baab481401
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
2 changed files with 28 additions and 0 deletions

View file

@ -29,4 +29,13 @@ class Bid
{
return $this->carrierId;
}
public function getBidLink(): ?string
{
$id = $this->id;
if ($id === null) {
return null;
}
return "https://freightquotes.com/bid/$id";
}
}

View 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()
);
}
}