26 lines
756 B
PHP
26 lines
756 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Tests\Entity;
|
||
|
|
|
||
|
|
use App\Entity\Customer;
|
||
|
|
use App\Entity\CustomerTracking;
|
||
|
|
use PHPUnit\Framework\TestCase;
|
||
|
|
|
||
|
|
class CustomerTrackingTest extends TestCase
|
||
|
|
{
|
||
|
|
public function testGettersAndSetters()
|
||
|
|
{
|
||
|
|
$tracking = new CustomerTracking();
|
||
|
|
$customer = new Customer();
|
||
|
|
$now = new \DateTime(); // CustomerTracking uses \DateTime, not \DateTimeImmutable
|
||
|
|
|
||
|
|
$tracking->setCustomer($customer);
|
||
|
|
$tracking->setCreateAT($now); // Use createAT
|
||
|
|
$tracking->setTrackId('track_id_123'); // Use trackId
|
||
|
|
|
||
|
|
$this->assertSame($customer, $tracking->getCustomer());
|
||
|
|
$this->assertSame($now, $tracking->getCreateAT());
|
||
|
|
$this->assertEquals('track_id_123', $tracking->getTrackId());
|
||
|
|
}
|
||
|
|
}
|