. */ namespace App\Tests\Entity\Parts; use App\Entity\Parts\AssociationType; use App\Entity\Parts\PartAssociation; use PHPUnit\Framework\TestCase; class PartAssociationTest extends TestCase { public function testGetTypeTranslationKey(): void { $assoc = new PartAssociation(); $assoc->setType(AssociationType::COMPATIBLE); $assoc->setOtherType('Custom Type'); //If the type is not OTHER the translation key should be the same as the type $this->assertSame($assoc->getType()->getTranslationKey(), $assoc->getTypeTranslationKey()); //If the type is OTHER the translation key should be the other type $assoc->setType(AssociationType::OTHER); $this->assertEquals($assoc->getOtherType(), $assoc->getTypeTranslationKey()); } }