LicenceCmfTest.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. namespace App\Tests\Unit\Service\Export\Model;
  3. use App\Entity\Core\File;
  4. use App\Service\Export\Model\LicenceCmf;
  5. use PHPUnit\Framework\TestCase;
  6. class LicenceCmfTest extends TestCase
  7. {
  8. /**
  9. * @see LicenceCmf::setId()
  10. * @see LicenceCmf::setYear()
  11. * @see LicenceCmf::setIsOrganizationLicence()
  12. * @see LicenceCmf::setOrganizationName()
  13. * @see LicenceCmf::setOrganizationIdentifier()
  14. * @see LicenceCmf::setFederationName()
  15. * @see LicenceCmf::setColor()
  16. * @see LicenceCmf::setLogoUri()
  17. * @see LicenceCmf::setQrCodeUri()
  18. * @see LicenceCmf::setPersonId()
  19. * @see LicenceCmf::setPersonGender()
  20. * @see LicenceCmf::setPersonFirstName()
  21. * @see LicenceCmf::setPersonLastName()
  22. * @see LicenceCmf::setPersonAvatarUri()
  23. *
  24. * @see LicenceCmf::getId()
  25. * @see LicenceCmf::getYear()
  26. * @see LicenceCmf::getIsOrganizationLicence()
  27. * @see LicenceCmf::getOrganizationName()
  28. * @see LicenceCmf::getOrganizationIdentifier()
  29. * @see LicenceCmf::getFederationName()
  30. * @see LicenceCmf::getColor()
  31. * @see LicenceCmf::getLogoUri()
  32. * @see LicenceCmf::getQrCodeUri()
  33. * @see LicenceCmf::getPersonId()
  34. * @see LicenceCmf::getPersonGender()
  35. * @see LicenceCmf::getPersonFirstName()
  36. * @see LicenceCmf::getPersonLastName()
  37. * @see LicenceCmf::getPersonAvatarUri()
  38. */
  39. public function testSetters(): void {
  40. $logo = $this->getMockBuilder(File::class)->getMock();
  41. $qrCode = $this->getMockBuilder(File::class)->getMock();
  42. $avatar = $this->getMockBuilder(File::class)->getMock();
  43. $model = new LicenceCmf();
  44. $model
  45. ->setId(1)
  46. ->setYear(2020)
  47. ->setIsOrganizationLicence(true)
  48. ->setOrganizationName('foo')
  49. ->setOrganizationIdentifier('123')
  50. ->setFederationName('bar')
  51. ->setColor('#55555')
  52. ->setLogo($logo)
  53. ->setQrCode($qrCode)
  54. ->setPersonId(2)
  55. ->setPersonGender('MR')
  56. ->setPersonFirstName('Don Diego')
  57. ->setPersonLastName('De la Vega')
  58. ->setPersonAvatar($avatar);
  59. $this->assertEquals(1, $model->getId());
  60. $this->assertEquals(2020, $model->getYear());
  61. $this->assertEquals(true, $model->isOrganizationLicence());
  62. $this->assertEquals('foo', $model->getOrganizationName());
  63. $this->assertEquals('123', $model->getOrganizationIdentifier());
  64. $this->assertEquals('bar', $model->getFederationName());
  65. $this->assertEquals('#55555', $model->getColor());
  66. $this->assertEquals($logo, $model->getLogo());
  67. $this->assertEquals($qrCode, $model->getQrCode());
  68. $this->assertEquals(2, $model->getPersonId());
  69. $this->assertEquals('MR', $model->getPersonGender());
  70. $this->assertEquals('Don Diego', $model->getPersonFirstName());
  71. $this->assertEquals('De la Vega', $model->getPersonLastName());
  72. $this->assertEquals($avatar, $model->getPersonAvatar());
  73. }
  74. }