mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
Issue336 internal create action fixes
This commit is contained in:
@@ -219,7 +219,6 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
|
||||
private ?string $telephone = null;
|
||||
|
||||
/**
|
||||
* @var array|null
|
||||
* @ORM\Column(name="types", type="json", nullable=true)
|
||||
*/
|
||||
private ?array $thirdPartyTypes = [];
|
||||
|
@@ -1,13 +1,25 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\ThirdPartyBundle\Test\Serializer\Normalizer;
|
||||
|
||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
|
||||
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
|
||||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
||||
|
||||
class ThirdPartyJsonDenormalizerTest extends KernelTestCase
|
||||
/**
|
||||
* @internal
|
||||
* @coversNothing
|
||||
*/
|
||||
final class ThirdPartyJsonDenormalizerTest extends KernelTestCase
|
||||
{
|
||||
private DenormalizerInterface $normalizer;
|
||||
|
||||
@@ -20,18 +32,18 @@ class ThirdPartyJsonDenormalizerTest extends KernelTestCase
|
||||
|
||||
public function testDenormalizeContact()
|
||||
{
|
||||
$str = <<<JSON
|
||||
{
|
||||
"type": "thirdparty",
|
||||
"name": "badaboum",
|
||||
"email": "badaboum@email.com",
|
||||
"telephone": "+32486540660",
|
||||
"kind": "contact"
|
||||
}
|
||||
JSON;
|
||||
$str = <<<'JSON'
|
||||
{
|
||||
"type": "thirdparty",
|
||||
"name": "badaboum",
|
||||
"email": "badaboum@email.com",
|
||||
"telephone": "+32486540660",
|
||||
"kind": "contact"
|
||||
}
|
||||
JSON;
|
||||
|
||||
$actual = $this->normalizer->denormalize(json_decode($str, true), ThirdParty::class, 'json', [
|
||||
'groups' => ['write']
|
||||
'groups' => ['write'],
|
||||
]);
|
||||
|
||||
$this->assertInstanceOf(ThirdParty::class, $actual);
|
||||
@@ -39,5 +51,4 @@ class ThirdPartyJsonDenormalizerTest extends KernelTestCase
|
||||
$this->assertEquals('badaboum@email.com', $actual->getEmail());
|
||||
$this->assertEquals(ThirdParty::KIND_CONTACT, $actual->getKind());
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user