Issue336 internal create action fixes

This commit is contained in:
2021-12-14 18:48:31 +00:00
committed by Julien Fastré
parent 45bcb27b79
commit 264bd76461
14 changed files with 154 additions and 146 deletions

View File

@@ -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 = [];

View File

@@ -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());
}
}