mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
finalize normalization on ressources
This commit is contained in:
@@ -61,7 +61,7 @@ class CommentEmbeddable
|
||||
|
||||
public function isEmpty()
|
||||
{
|
||||
return empty($this->getComment());
|
||||
return null === $this->getComment() || '' === $this->getComment();
|
||||
}
|
||||
|
||||
public function setComment(?string $comment)
|
||||
|
@@ -39,7 +39,7 @@ class CommentEmbeddableDocGenNormalizer implements ContextAwareNormalizerInterfa
|
||||
*/
|
||||
public function normalize($object, ?string $format = null, array $context = []): array
|
||||
{
|
||||
if (null === $object or (null === $object->getComment() and null === $object->getUserId() and null === $object->getDate())) {
|
||||
if (null === $object || ($object->isEmpty())) {
|
||||
return [
|
||||
'comment' => '',
|
||||
'isNull' => true,
|
||||
|
@@ -101,7 +101,9 @@ final class UserControllerTest extends WebTestCase
|
||||
|
||||
// Check data in the show view
|
||||
$this->assertStringContainsString(
|
||||
"Test_user", $crawler->text(), "page contains the name of the user"
|
||||
'Test_user',
|
||||
$crawler->text(),
|
||||
'page contains the name of the user'
|
||||
);
|
||||
|
||||
//test the auth of the new client
|
||||
|
Reference in New Issue
Block a user