Skip to content

Commit

Permalink
[Serializer] Fix tests for extended Context attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus committed Jul 27, 2023
1 parent 1935af6 commit 2a6e93e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ class ContextChildMetadataDummy
* @var \DateTime
*/
#[Groups(['extended', 'simple'])]
#[Context([DateTimeNormalizer::FORMAT_KEY => \DateTimeInterface::RFC3339])]
#[Context(
#[DummyContextChild([DateTimeNormalizer::FORMAT_KEY => \DateTimeInterface::RFC3339])]
#[DummyContextChild(
normalizationContext: [DateTimeNormalizer::FORMAT_KEY => \DateTimeInterface::RFC3339_EXTENDED],
groups: ['extended'],
)]
#[Context(
#[DummyContextChild(
denormalizationContext: [DateTimeNormalizer::FORMAT_KEY => 'd/m/Y'],
groups: ['simple'],
)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,7 @@

use Symfony\Component\Serializer\Annotation\Context;

/**
* Annotation class for @DummyContextChild().
*
* @Annotation
* @NamedArgumentConstructor
* @Target({"PROPERTY", "METHOD"})
*/
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY)]
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY | \Attribute::IS_REPEATABLE)]
class DummyContextChild extends Context
{
}

0 comments on commit 2a6e93e

Please sign in to comment.