diff --git a/tests/Documents/FileWithoutMetadata.php b/tests/Documents/FileWithoutMetadata.php index be82621488..806276b2bf 100644 --- a/tests/Documents/FileWithoutMetadata.php +++ b/tests/Documents/FileWithoutMetadata.php @@ -18,6 +18,7 @@ class FileWithoutMetadata * * @var string|null */ + #[ODM\File\Filename] private $filename; public function getId(): ?string diff --git a/tests/Tests/Mapping/AbstractMappingDriverTestCase.php b/tests/Tests/Mapping/AbstractMappingDriverTestCase.php index 2b60e8d1f9..5d790898f9 100644 --- a/tests/Tests/Mapping/AbstractMappingDriverTestCase.php +++ b/tests/Tests/Mapping/AbstractMappingDriverTestCase.php @@ -1254,7 +1254,7 @@ class AbstractMappingDriverDuplicateDatabaseNameNotSaved extends AbstractMapping * * @var string|null */ - #[ODM\Field(type: 'int', name: 'baz')] + #[ODM\Field(type: 'string', name: 'baz')] public $foo; /** @@ -1262,7 +1262,7 @@ class AbstractMappingDriverDuplicateDatabaseNameNotSaved extends AbstractMapping * * @var string|null */ - #[ODM\Field(type: 'int', name: 'baz', notSaved: true)] + #[ODM\Field(type: 'string', name: 'baz', notSaved: true)] public $bar; } diff --git a/tests/Tests/Mapping/Documents/GlobalNamespaceDocument.php b/tests/Tests/Mapping/Documents/GlobalNamespaceDocument.php index 5e28402940..ef5a740d26 100644 --- a/tests/Tests/Mapping/Documents/GlobalNamespaceDocument.php +++ b/tests/Tests/Mapping/Documents/GlobalNamespaceDocument.php @@ -6,6 +6,7 @@ use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM; /** @ODM\Document */ +#[ODM\Document] class DoctrineGlobal_Article { /** @@ -13,6 +14,7 @@ class DoctrineGlobal_Article * * @var string|null */ + #[ODM\Id] protected $id; /** @@ -20,6 +22,7 @@ class DoctrineGlobal_Article * * @var string|null */ + #[ODM\Field(type: 'string')] protected $headline; /** @@ -27,6 +30,7 @@ class DoctrineGlobal_Article * * @var string|null */ + #[ODM\Field(type: 'string')] protected $text; /** @@ -34,6 +38,7 @@ class DoctrineGlobal_Article * * @var DoctrineGlobal_User|null */ + #[ODM\ReferenceMany(targetDocument: DoctrineGlobal_User::class)] protected $author; /** @@ -41,10 +46,12 @@ class DoctrineGlobal_Article * * @var Collection */ + #[ODM\ReferenceMany(targetDocument: DoctrineGlobal_User::class)] protected $editor; } /** @ODM\Document */ +#[ODM\Document] class DoctrineGlobal_User { /** @@ -52,6 +59,7 @@ class DoctrineGlobal_User * * @var string|null */ + #[ODM\Id] private $id; /** @@ -59,6 +67,7 @@ class DoctrineGlobal_User * * @var string */ + #[ODM\Field(type: 'string')] private $username; /** @@ -66,5 +75,6 @@ class DoctrineGlobal_User * * @var string */ + #[ODM\Field(type: 'string')] private $email; } diff --git a/tests/Tests/Tools/GH1299/BaseUser.php b/tests/Tests/Tools/GH1299/BaseUser.php index 9b1473d0cb..277c84c176 100644 --- a/tests/Tests/Tools/GH1299/BaseUser.php +++ b/tests/Tests/Tools/GH1299/BaseUser.php @@ -7,6 +7,7 @@ use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM; /** @ODM\Document */ +#[ODM\Document] class BaseUser { /** @@ -14,6 +15,7 @@ class BaseUser * * @var string|null */ + #[ODM\Id] protected $id; /** @@ -21,6 +23,7 @@ class BaseUser * * @var string|null */ + #[ODM\Field(type: 'string')] protected $name; public function getId(): ?string diff --git a/tests/Tests/Tools/GH1299/GH1299User.php b/tests/Tests/Tools/GH1299/GH1299User.php index 4d205b1612..64ed574e58 100644 --- a/tests/Tests/Tools/GH1299/GH1299User.php +++ b/tests/Tests/Tools/GH1299/GH1299User.php @@ -7,6 +7,7 @@ use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM; /** @ODM\Document */ +#[ODM\Document] class GH1299User extends BaseUser { /** @@ -14,5 +15,6 @@ class GH1299User extends BaseUser * * @var string|null */ + #[ODM\Field(type: 'string')] protected $lastname; } diff --git a/tests/Tests/Tools/GH297/Address.php b/tests/Tests/Tools/GH297/Address.php index 6b921ea0a6..5a0c11f266 100644 --- a/tests/Tests/Tools/GH297/Address.php +++ b/tests/Tests/Tools/GH297/Address.php @@ -7,6 +7,7 @@ use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM; /** @ODM\EmbeddedDocument */ +#[ODM\EmbeddedDocument] class Address { /** @@ -14,6 +15,7 @@ class Address * * @var string|null */ + #[ODM\Field(type: 'string')] private $street; public function getStreet(): ?string diff --git a/tests/Tests/Tools/GH297/AddressTrait.php b/tests/Tests/Tools/GH297/AddressTrait.php index 9c0ba02168..eea24926f8 100644 --- a/tests/Tests/Tools/GH297/AddressTrait.php +++ b/tests/Tests/Tools/GH297/AddressTrait.php @@ -4,6 +4,8 @@ namespace Doctrine\ODM\MongoDB\Tests\Tools\GH297; +use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM; + trait AddressTrait { /** @@ -11,6 +13,7 @@ trait AddressTrait * * @var Address|null */ + #[ODM\EmbedOne] private $address; public function getAddress(): ?Address diff --git a/tests/Tests/Tools/GH297/Admin.php b/tests/Tests/Tools/GH297/Admin.php index fedea6f7ac..70011f5fa3 100644 --- a/tests/Tests/Tools/GH297/Admin.php +++ b/tests/Tests/Tools/GH297/Admin.php @@ -7,6 +7,7 @@ use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM; /** @ODM\Document */ +#[ODM\Document] class Admin extends User { } diff --git a/tests/Tests/Tools/GH297/User.php b/tests/Tests/Tools/GH297/User.php index d0f19462cd..9fd9bca8bf 100644 --- a/tests/Tests/Tools/GH297/User.php +++ b/tests/Tests/Tools/GH297/User.php @@ -7,6 +7,7 @@ use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM; /** @ODM\Document */ +#[ODM\Document] class User { use AddressTrait; @@ -16,6 +17,7 @@ class User * * @var string|null */ + #[ODM\Id] private $id; /** @@ -23,6 +25,7 @@ class User * * @var string|null */ + #[ODM\Field(type: 'string')] private $name; public function getId(): ?string