Skip to content

feat: use attributes instead annotations in tests #1707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions tests/Maker/MakeAuthenticatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
use Symfony\Bundle\MakerBundle\Test\MakerTestRunner;
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;

/**
* @group legacy
*/
#[\PHPUnit\Framework\Attributes\Group('legacy')]

Check failure on line 19 in tests/Maker/MakeAuthenticatorTest.php

View workflow job for this annotation

GitHub Actions / PHPStan

Attribute class PHPUnit\Framework\Attributes\Group does not exist.
class MakeAuthenticatorTest extends MakerTestCase
{
protected function getMakerClass(): string
Expand Down
4 changes: 1 addition & 3 deletions tests/Maker/MakeFunctionalTestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
use Symfony\Bundle\MakerBundle\Test\MakerTestDetails;
use Symfony\Bundle\MakerBundle\Test\MakerTestRunner;

/**
* @group legacy
*/
#[\PHPUnit\Framework\Attributes\Group('legacy')]

Check failure on line 19 in tests/Maker/MakeFunctionalTestTest.php

View workflow job for this annotation

GitHub Actions / PHPStan

Attribute class PHPUnit\Framework\Attributes\Group does not exist.
class MakeFunctionalTestTest extends MakerTestCase
{
protected function getMakerClass(): string
Expand Down
4 changes: 1 addition & 3 deletions tests/Maker/MakeScheduleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
use Symfony\Bundle\MakerBundle\Test\MakerTestCase;
use Symfony\Bundle\MakerBundle\Test\MakerTestRunner;

/**
* @group legacy
*/
#[\PHPUnit\Framework\Attributes\Group('legacy')]

Check failure on line 18 in tests/Maker/MakeScheduleTest.php

View workflow job for this annotation

GitHub Actions / PHPStan

Attribute class PHPUnit\Framework\Attributes\Group does not exist.
class MakeScheduleTest extends MakerTestCase
{
protected function getMakerClass(): string
Expand Down
4 changes: 1 addition & 3 deletions tests/Maker/MakeSubscriberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
use Symfony\Bundle\MakerBundle\Test\MakerTestCase;
use Symfony\Bundle\MakerBundle\Test\MakerTestRunner;

/**
* @group legacy
*/
#[\PHPUnit\Framework\Attributes\Group('legacy')]

Check failure on line 18 in tests/Maker/MakeSubscriberTest.php

View workflow job for this annotation

GitHub Actions / PHPStan

Attribute class PHPUnit\Framework\Attributes\Group does not exist.
class MakeSubscriberTest extends MakerTestCase
{
protected function getMakerClass(): string
Expand Down
4 changes: 1 addition & 3 deletions tests/Maker/MakeUnitTestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
use Symfony\Bundle\MakerBundle\Test\MakerTestCase;
use Symfony\Bundle\MakerBundle\Test\MakerTestRunner;

/**
* @group legacy
*/
#[\PHPUnit\Framework\Attributes\Group('legacy')]

Check failure on line 18 in tests/Maker/MakeUnitTestTest.php

View workflow job for this annotation

GitHub Actions / PHPStan

Attribute class PHPUnit\Framework\Attributes\Group does not exist.
class MakeUnitTestTest extends MakerTestCase
{
protected function getMakerClass(): string
Expand Down
4 changes: 1 addition & 3 deletions tests/Util/fixtures/source/User_only_props.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ class User
#[ORM\Column()]
private ?int $id = null;

/**
* @ORM\Column()
*/
#[ORM\Column]
private $firstName;
}
4 changes: 1 addition & 3 deletions tests/fixtures/make-form/embeddable/Food.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ class Food
#[ORM\Column]
private ?string $title = null;

/**
* @ORM\Embedded(class=Receipt::class)
*/
#[ORM\Embedded(class: Receipt::class)]
private $receipt;

public function __construct()
Expand Down
12 changes: 3 additions & 9 deletions tests/fixtures/make-form/embeddable/Receipt.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,12 @@

use Doctrine\ORM\Mapping as ORM;

/**
* @ORM\Embeddable()
*/
#[ORM\Embeddable]
class Receipt
{
/**
* @ORM\Column(type="string", length=255)
*/
#[ORM\Column(type: 'string', length: 255)]
private $ingredients;

/**
* @ORM\Column(type="string", length=255)
*/
#[ORM\Column(type: 'string', length: 255)]
private $steps;
}
Loading