mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
thirdparty docgen normalizer: fix return type for telephone
This commit is contained in:
@@ -221,7 +221,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
|
||||
* message="Invalid phone number: it should begin with the international prefix starting with ""+"", hold only digits and be smaller than 20 characters. Ex: +33123456789"
|
||||
* )
|
||||
* @PhonenumberConstraint(type="any")
|
||||
* @Groups({"read", "write", "dogen:read", "docgen:read:3party:parent"})
|
||||
* @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"})
|
||||
*/
|
||||
private ?string $telephone = null;
|
||||
|
||||
@@ -464,10 +464,8 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
|
||||
|
||||
/**
|
||||
* Get telephone.
|
||||
*
|
||||
* @return string|null
|
||||
*/
|
||||
public function getTelephone()
|
||||
public function getTelephone(): ?string
|
||||
{
|
||||
return $this->telephone;
|
||||
}
|
||||
|
@@ -91,11 +91,14 @@ final class ThirdPartyDocGenNormalizerTest extends KernelTestCase
|
||||
->setName('test')
|
||||
->setCivility((new Civility())->setName(['fr' => 'Monsieur'])->setAbbreviation(['fr' => 'M.']))
|
||||
->setEmail('info@cl.coop')
|
||||
->setTelephone('+32486123456')
|
||||
->addTypesAndCategories('kind')
|
||||
->addTypesAndCategories((new ThirdPartyCategory())->setName(['fr' => 'category']));
|
||||
|
||||
$actual = $this->normalizer->normalize($thirdparty, 'docgen', ['groups' => ['docgen:read']]);
|
||||
|
||||
$this->assertIsArray($actual);
|
||||
$this->assertArrayHasKey('telephone', $actual);
|
||||
$this->assertEquals('+32486123456', $actual['telephone']);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user