Skip to content

Commit

Permalink
[Test] Add test for combination aliased + sub namespace usage on Anno…
Browse files Browse the repository at this point in the history
…tationToAttributeRector (#5289)
  • Loading branch information
samsonasik authored Nov 26, 2023
1 parent b11e87f commit 09a962c
Showing 1 changed file with 58 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php

namespace Rector\Core\Tests\Issues\FqcnAnnotationToAttribute\Fixture;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints;
use Symfony\Component\Validator\Constraints as SymfonyConstraints;
use Symfony\Component\Serializer\Annotation\Groups;

/**
* @ORM\Entity()
* @ORM\Table("user", indexes={
* @ORM\Index(name="name_index", columns={"name"}),
* @ORM\Index(name="surname_index", columns={"surname"}),
* })
* @Constraints\UniqueEntity("azureB2cUuid")
* @Constraints\UniqueEntity("uuid")
* @Constraints\UniqueEntity("email")
*/
class AliasedAndSubNamespace
{
/**
* @SymfonyConstraints\NotBlank()
* @SymfonyConstraints\Email(mode="strict")
* @ORM\Column(type="string", unique=true)
* @Groups({"import", "export-user", "export-claim"})
*/
protected string $email = "";
}

?>
-----
<?php

namespace Rector\Core\Tests\Issues\FqcnAnnotationToAttribute\Fixture;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints;
use Symfony\Component\Validator\Constraints as SymfonyConstraints;
use Symfony\Component\Serializer\Annotation\Groups;

#[ORM\Entity]
#[Constraints\UniqueEntity('azureB2cUuid')]
#[Constraints\UniqueEntity('uuid')]
#[Constraints\UniqueEntity('email')]
#[ORM\Table('user')]
#[ORM\Index(name: 'name_index', columns: ['name'])]
#[ORM\Index(name: 'surname_index', columns: ['surname'])]
class AliasedAndSubNamespace
{
#[SymfonyConstraints\NotBlank]
#[SymfonyConstraints\Email(mode: 'strict')]
#[ORM\Column(type: 'string', unique: true)]
#[Groups(['import', 'export-user', 'export-claim'])]
protected string $email = "";
}

?>

0 comments on commit 09a962c

Please sign in to comment.