Skip to content
Merged
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
1 change: 1 addition & 0 deletions tests/Documents/FileWithoutMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class FileWithoutMetadata
*
* @var string|null
*/
#[ODM\File\Filename]
private $filename;

public function getId(): ?string
Expand Down
4 changes: 2 additions & 2 deletions tests/Tests/Mapping/AbstractMappingDriverTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -1254,15 +1254,15 @@ class AbstractMappingDriverDuplicateDatabaseNameNotSaved extends AbstractMapping
*
* @var string|null
*/
#[ODM\Field(type: 'int', name: 'baz')]
#[ODM\Field(type: 'string', name: 'baz')]
public $foo;

/**
* @ODM\Field(type="string", name="baz", notSaved=true)
*
* @var string|null
*/
#[ODM\Field(type: 'int', name: 'baz', notSaved: true)]
#[ODM\Field(type: 'string', name: 'baz', notSaved: true)]
public $bar;
}

Expand Down
10 changes: 10 additions & 0 deletions tests/Tests/Mapping/Documents/GlobalNamespaceDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,65 +6,75 @@
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;

/** @ODM\Document */
#[ODM\Document]
class DoctrineGlobal_Article
{
/**
* @ODM\Id
*
* @var string|null
*/
#[ODM\Id]
protected $id;

/**
* @ODM\Field(type="string")
*
* @var string|null
*/
#[ODM\Field(type: 'string')]
protected $headline;

/**
* @ODM\Field(type="string")
*
* @var string|null
*/
#[ODM\Field(type: 'string')]
protected $text;

/**
* @ODM\ReferenceMany(targetDocument=DoctrineGlobal_User::class)
*
* @var DoctrineGlobal_User|null
*/
#[ODM\ReferenceMany(targetDocument: DoctrineGlobal_User::class)]
protected $author;

/**
* @ODM\ReferenceMany(targetDocument=DoctrineGlobal_User::class)
*
* @var Collection<int, DoctrineGlobal_User>
*/
#[ODM\ReferenceMany(targetDocument: DoctrineGlobal_User::class)]
protected $editor;
}

/** @ODM\Document */
#[ODM\Document]
class DoctrineGlobal_User
{
/**
* @ODM\Id
*
* @var string|null
*/
#[ODM\Id]
private $id;

/**
* @ODM\Field(type="string")
*
* @var string
*/
#[ODM\Field(type: 'string')]
private $username;

/**
* @ODM\Field(type="string")
*
* @var string
*/
#[ODM\Field(type: 'string')]
private $email;
}
3 changes: 3 additions & 0 deletions tests/Tests/Tools/GH1299/BaseUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,23 @@
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;

/** @ODM\Document */
#[ODM\Document]
class BaseUser
{
/**
* @ODM\Id
*
* @var string|null
*/
#[ODM\Id]
protected $id;

/**
* @ODM\Field(type="string")
*
* @var string|null
*/
#[ODM\Field(type: 'string')]
protected $name;

public function getId(): ?string
Expand Down
2 changes: 2 additions & 0 deletions tests/Tests/Tools/GH1299/GH1299User.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;

/** @ODM\Document */
#[ODM\Document]
class GH1299User extends BaseUser
{
/**
* @ODM\Field(type="string")
*
* @var string|null
*/
#[ODM\Field(type: 'string')]
protected $lastname;
}
2 changes: 2 additions & 0 deletions tests/Tests/Tools/GH297/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;

/** @ODM\EmbeddedDocument */
#[ODM\EmbeddedDocument]
class Address
{
/**
* @ODM\Field(type="string")
*
* @var string|null
*/
#[ODM\Field(type: 'string')]
private $street;

public function getStreet(): ?string
Expand Down
3 changes: 3 additions & 0 deletions tests/Tests/Tools/GH297/AddressTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@

namespace Doctrine\ODM\MongoDB\Tests\Tools\GH297;

use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;

trait AddressTrait
{
/**
* @ODM\EmbedOne
*
* @var Address|null
*/
#[ODM\EmbedOne]
private $address;

public function getAddress(): ?Address
Expand Down
1 change: 1 addition & 0 deletions tests/Tests/Tools/GH297/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;

/** @ODM\Document */
#[ODM\Document]
class Admin extends User
{
}
3 changes: 3 additions & 0 deletions tests/Tests/Tools/GH297/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;

/** @ODM\Document */
#[ODM\Document]
class User
{
use AddressTrait;
Expand All @@ -16,13 +17,15 @@ class User
*
* @var string|null
*/
#[ODM\Id]
private $id;

/**
* @ODM\Field(type="string")
*
* @var string|null
*/
#[ODM\Field(type: 'string')]
private $name;

public function getId(): ?string
Expand Down