-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Move tests requiring PHP ≥ 8.1 to their own directory #10683
Closed
+130
−174
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
49 changes: 0 additions & 49 deletions
49
tests/Doctrine/Tests/ORM/Functional/Ticket/GH10132Test.php
This file was deleted.
Oops, something went wrong.
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
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,117 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Tests_PHP81\ORM\Functional\Ticket; | ||
|
||
use Doctrine\Common\Collections\ArrayCollection; | ||
use Doctrine\Common\Collections\Collection; | ||
use Doctrine\Tests\Models\Enums\Suit; | ||
use Doctrine\Tests\OrmFunctionalTestCase; | ||
|
||
class GH10132Test extends OrmFunctionalTestCase | ||
{ | ||
public function setUp(): void | ||
{ | ||
parent::setUp(); | ||
|
||
$this->createSchemaForModels( | ||
Complex::class, | ||
ComplexChild::class | ||
); | ||
} | ||
|
||
public function testQueryBackedEnumInCompositeKeyJoin(): void | ||
{ | ||
$complex = new Complex(); | ||
$complex->setType(Suit::Clubs); | ||
|
||
$complexChild = new ComplexChild(); | ||
$complexChild->setComplex($complex); | ||
|
||
$this->_em->persist($complex); | ||
$this->_em->persist($complexChild); | ||
$this->_em->flush(); | ||
$this->_em->clear(); | ||
|
||
$qb = $this->_em->createQueryBuilder(); | ||
$qb->select('s') | ||
->from(ComplexChild::class, 's') | ||
->where('s.complexType = :complexType'); | ||
|
||
$qb->setParameter('complexType', Suit::Clubs); | ||
|
||
self::assertNotNull($qb->getQuery()->getOneOrNullResult()); | ||
} | ||
} | ||
|
||
/** @Entity */ | ||
class Complex | ||
{ | ||
/** | ||
* @Id | ||
* @Column(type = "string", enumType = Suit::class) | ||
*/ | ||
protected Suit $type; | ||
|
||
/** @OneToMany(targetEntity = ComplexChild::class, mappedBy = "complex", cascade = {"persist"}) */ | ||
protected Collection $complexChildren; | ||
|
||
public function __construct() | ||
{ | ||
$this->complexChildren = new ArrayCollection(); | ||
} | ||
|
||
public function getType(): Suit | ||
{ | ||
return $this->type; | ||
} | ||
|
||
public function setType(Suit $type): void | ||
{ | ||
$this->type = $type; | ||
} | ||
|
||
public function getComplexChildren(): Collection | ||
{ | ||
return $this->complexChildren; | ||
} | ||
|
||
public function addComplexChild(ComplexChild $complexChild): void | ||
{ | ||
$this->complexChildren->add($complexChild); | ||
} | ||
} | ||
|
||
/** @Entity */ | ||
class ComplexChild | ||
{ | ||
/** | ||
* @ManyToOne(targetEntity = Complex::class, inversedBy = "complexChildren") | ||
* @JoinColumn(name = "complexType", referencedColumnName = "type", nullable = false) | ||
*/ | ||
protected Complex $complex; | ||
|
||
/** | ||
* @Id | ||
* @Column(type = "string", enumType = Suit::class) | ||
*/ | ||
protected Suit $complexType; | ||
|
||
public function setComplex(Complex $complex): void | ||
{ | ||
$complex->addComplexChild($this); | ||
$this->complexType = $complex->getType(); | ||
$this->complex = $complex; | ||
} | ||
|
||
public function getComplexType(): Suit | ||
{ | ||
return $this->complexType; | ||
} | ||
|
||
public function getComplex(): Complex | ||
{ | ||
return $this->complex; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -15,14 +15,11 @@ | |
use Doctrine\ORM\Mapping\GeneratedValue; | ||
use Doctrine\ORM\Mapping\Id; | ||
use Doctrine\ORM\Mapping\InheritanceType; | ||
use Doctrine\Tests\Models\GH10288\GH10288People; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The namespace of this file (can't comment directly on it) is wrong now, right? |
||
use Doctrine\Tests\OrmFunctionalTestCase; | ||
|
||
/** | ||
* This test makes sure that Discriminator columns can use both custom types using PHP enums as well as | ||
* enumType definition of enums. | ||
* | ||
* @requires PHP 8.1 | ||
*/ | ||
class GH10288Test extends OrmFunctionalTestCase | ||
{ | ||
|
@@ -114,6 +111,12 @@ public function testEnumDiscriminatorWithCustomEnumType(): void | |
} | ||
} | ||
|
||
enum GH10288People: string | ||
{ | ||
case BOSS = 'boss'; | ||
case EMPLOYEE = 'employee'; | ||
} | ||
|
||
class GH10288PeopleType extends StringType | ||
{ | ||
public const NAME = 'GH10288PeopleType'; | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is indeed no import statement for this… why does the test suite pass when run on Github 🤔 ?
EDIT: Github says it ran 3689 tests… locally, I have 3722 tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 I think you need to modify all of these files: https://github.com/doctrine/orm/tree/2.15.x/ci/github/phpunit