<?php

namespace App\Tests\Unit\Service\Export\Model;

use App\Entity\Core\File;
use App\Service\Export\Model\LicenceCmf;
use PHPUnit\Framework\TestCase;

class LicenceCmfTest extends TestCase
{
    /**
     * @see LicenceCmf::setId()
     * @see LicenceCmf::setYear()
     * @see LicenceCmf::setIsOrganizationLicence()
     * @see LicenceCmf::setOrganizationName()
     * @see LicenceCmf::setOrganizationIdentifier()
     * @see LicenceCmf::setFederationName()
     * @see LicenceCmf::setColor()
     * @see LicenceCmf::setLogoUri()
     * @see LicenceCmf::setQrCodeUri()
     * @see LicenceCmf::setPersonId()
     * @see LicenceCmf::setPersonGender()
     * @see LicenceCmf::setPersonFirstName()
     * @see LicenceCmf::setPersonLastName()
     * @see LicenceCmf::setPersonAvatarUri()
     *
     * @see LicenceCmf::getId()
     * @see LicenceCmf::getYear()
     * @see LicenceCmf::getIsOrganizationLicence()
     * @see LicenceCmf::getOrganizationName()
     * @see LicenceCmf::getOrganizationIdentifier()
     * @see LicenceCmf::getFederationName()
     * @see LicenceCmf::getColor()
     * @see LicenceCmf::getLogoUri()
     * @see LicenceCmf::getQrCodeUri()
     * @see LicenceCmf::getPersonId()
     * @see LicenceCmf::getPersonGender()
     * @see LicenceCmf::getPersonFirstName()
     * @see LicenceCmf::getPersonLastName()
     * @see LicenceCmf::getPersonAvatarUri()
     */
    public function testSetters(): void {

        $logo = $this->getMockBuilder(File::class)->getMock();
        $qrCode = $this->getMockBuilder(File::class)->getMock();
        $avatar = $this->getMockBuilder(File::class)->getMock();

        $model = new LicenceCmf();
        $model
            ->setId(1)
            ->setYear(2020)
            ->setIsOrganizationLicence(true)
            ->setOrganizationName('foo')
            ->setOrganizationIdentifier('123')
            ->setFederationName('bar')
            ->setColor('#55555')
            ->setLogo($logo)
            ->setQrCode($qrCode)
            ->setPersonId(2)
            ->setPersonGender('MR')
            ->setPersonFirstName('Don Diego')
            ->setPersonLastName('De la Vega')
            ->setPersonAvatar($avatar);

        $this->assertEquals(1, $model->getId());
        $this->assertEquals(2020, $model->getYear());
        $this->assertEquals(true, $model->isOrganizationLicence());
        $this->assertEquals('foo', $model->getOrganizationName());
        $this->assertEquals('123', $model->getOrganizationIdentifier());
        $this->assertEquals('bar', $model->getFederationName());
        $this->assertEquals('#55555', $model->getColor());
        $this->assertEquals($logo, $model->getLogo());
        $this->assertEquals($qrCode, $model->getQrCode());
        $this->assertEquals(2, $model->getPersonId());
        $this->assertEquals('MR', $model->getPersonGender());
        $this->assertEquals('Don Diego', $model->getPersonFirstName());
        $this->assertEquals('De la Vega', $model->getPersonLastName());
        $this->assertEquals($avatar, $model->getPersonAvatar());
    }

}
