28 lines
713 B
PHP
28 lines
713 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Tests\Entity;
|
||
|
|
|
||
|
|
use App\Entity\Contrats;
|
||
|
|
use App\Entity\Facture;
|
||
|
|
use PHPUnit\Framework\TestCase;
|
||
|
|
|
||
|
|
class FactureTest extends TestCase
|
||
|
|
{
|
||
|
|
public function testGettersAndSetters()
|
||
|
|
{
|
||
|
|
$facture = new Facture();
|
||
|
|
$contrat = new Contrats();
|
||
|
|
$now = new \DateTimeImmutable();
|
||
|
|
|
||
|
|
$facture->setContrat($contrat);
|
||
|
|
$facture->setNum('INV-001');
|
||
|
|
$facture->setCreateAt($now);
|
||
|
|
$facture->setUpdateAt($now);
|
||
|
|
|
||
|
|
$this->assertSame($contrat, $facture->getContrat());
|
||
|
|
$this->assertEquals('INV-001', $facture->getNum());
|
||
|
|
$this->assertSame($now, $facture->getCreateAt());
|
||
|
|
$this->assertSame($now, $facture->getUpdateAt());
|
||
|
|
}
|
||
|
|
}
|