LicenceCmfCollectionTest.php 804 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace App\Tests\Unit\Service\Export\Model;
  3. use App\Service\Export\Model\LicenceCmf;
  4. use App\Service\Export\Model\LicenceCmfCollection;
  5. use PHPUnit\Framework\TestCase;
  6. class LicenceCmfCollectionTest extends TestCase
  7. {
  8. /**
  9. * @see LicenceCmf::getLicences()
  10. * @see LicenceCmf::addLicence()
  11. * @see LicenceCmf::setLicences()
  12. */
  13. public function testSetters(): void {
  14. $collection = new LicenceCmfCollection();
  15. $model = $this->getMockBuilder(LicenceCmf::class)->getMock();
  16. $this->assertEquals([], $collection->getLicences());
  17. $collection->addLicence($model);
  18. $this->assertEquals([$model], $collection->getLicences());
  19. $collection->setLicences([]);
  20. $this->assertEquals([], $collection->getLicences());
  21. }
  22. }