-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip tests related to PersistentObject if that class is missing
- Loading branch information
Showing
5 changed files
with
138 additions
and
98 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
tests/Doctrine/Tests/Models/PersistentObject/PersistentCollectionContent.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Tests\Models\PersistentObject; | ||
|
||
use Doctrine\Common\Persistence\PersistentObject; | ||
use Doctrine\ORM\Mapping\Column; | ||
use Doctrine\ORM\Mapping\Entity; | ||
use Doctrine\ORM\Mapping\GeneratedValue; | ||
use Doctrine\ORM\Mapping\Id; | ||
|
||
/** | ||
* @Entity | ||
*/ | ||
class PersistentCollectionContent extends PersistentObject | ||
{ | ||
/** | ||
* @Id | ||
* @Column(type="integer") | ||
* @GeneratedValue | ||
* @var int | ||
*/ | ||
protected $id; | ||
} |
60 changes: 60 additions & 0 deletions
60
tests/Doctrine/Tests/Models/PersistentObject/PersistentCollectionHolder.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Tests\Models\PersistentObject; | ||
|
||
use Doctrine\Common\Collections\ArrayCollection; | ||
use Doctrine\Common\Collections\Collection; | ||
use Doctrine\Common\Persistence\PersistentObject; | ||
use Doctrine\ORM\Mapping\Column; | ||
use Doctrine\ORM\Mapping\Entity; | ||
use Doctrine\ORM\Mapping\GeneratedValue; | ||
use Doctrine\ORM\Mapping\Id; | ||
use Doctrine\ORM\Mapping\ManyToMany; | ||
|
||
/** | ||
* @Entity | ||
*/ | ||
class PersistentCollectionHolder extends PersistentObject | ||
{ | ||
/** | ||
* @Id | ||
* @Column(type="integer") | ||
* @GeneratedValue | ||
* @var int | ||
*/ | ||
protected $id; | ||
|
||
/** | ||
* @var Collection | ||
* @ManyToMany(targetEntity="PersistentCollectionContent", cascade={"all"}, fetch="EXTRA_LAZY") | ||
*/ | ||
protected $collection; | ||
|
||
public function __construct() | ||
{ | ||
$this->collection = new ArrayCollection(); | ||
} | ||
|
||
public function addElement(PersistentCollectionContent $element): void | ||
{ | ||
$this->collection->add($element); | ||
} | ||
|
||
/** | ||
* @return Collection | ||
*/ | ||
public function getCollection(): Collection | ||
{ | ||
return clone $this->collection; | ||
} | ||
|
||
/** | ||
* @return Collection | ||
*/ | ||
public function getRawCollection(): Collection | ||
{ | ||
return $this->collection; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
tests/Doctrine/Tests/Models/PersistentObject/PersistentEntity.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Tests\Models\PersistentObject; | ||
|
||
use Doctrine\Common\Persistence\PersistentObject; | ||
use Doctrine\ORM\Mapping\Column; | ||
use Doctrine\ORM\Mapping\Entity; | ||
use Doctrine\ORM\Mapping\GeneratedValue; | ||
use Doctrine\ORM\Mapping\Id; | ||
use Doctrine\ORM\Mapping\ManyToOne; | ||
|
||
/** | ||
* @Entity | ||
*/ | ||
class PersistentEntity extends PersistentObject | ||
{ | ||
/** | ||
* @Id | ||
* @Column(type="integer") | ||
* @GeneratedValue | ||
* @var int | ||
*/ | ||
protected $id; | ||
|
||
/** | ||
* @Column(type="string") | ||
* @var string | ||
*/ | ||
protected $name; | ||
|
||
/** | ||
* @ManyToOne(targetEntity="PersistentEntity") | ||
* @var PersistentEntity | ||
*/ | ||
protected $parent; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters