LicenceCmfCollectionTest.php 807 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. {
  15. $collection = new LicenceCmfCollection();
  16. $model = $this->getMockBuilder(LicenceCmf::class)->getMock();
  17. $this->assertEquals([], $collection->getLicences());
  18. $collection->addLicence($model);
  19. $this->assertEquals([$model], $collection->getLicences());
  20. $collection->setLicences([]);
  21. $this->assertEquals([], $collection->getLicences());
  22. }
  23. }