Skip to content

Proxy class with BackedEnum as primary key does not convert the enum#12063

Merged
greg0ire merged 2 commits intodoctrine:3.5.xfrom
wmouwen:test/gh-10788
Jul 14, 2025
Merged

Proxy class with BackedEnum as primary key does not convert the enum#12063
greg0ire merged 2 commits intodoctrine:3.5.xfrom
wmouwen:test/gh-10788

Conversation

@wmouwen
Copy link
Copy Markdown
Contributor

@wmouwen wmouwen commented Jul 7, 2025

There was 1 error:

1) Doctrine\Tests\ORM\Functional\Ticket\GH12063::testProxyAssociationWithBackedEnum
Error: Object of class Doctrine\Tests\ORM\Functional\Ticket\GH12063Code could not be converted to string

vendor/doctrine/dbal/src/Driver/PDO/Statement.php:26
vendor/doctrine/dbal/src/Driver/Middleware/AbstractStatementMiddleware.php:19
vendor/doctrine/dbal/src/Logging/Statement.php:35
vendor/doctrine/dbal/src/Statement.php:93
src/Persisters/Entity/BasicEntityPersister.php:257
src/UnitOfWork.php:1057
src/UnitOfWork.php:402
src/EntityManager.php:268
tests/Doctrine/Tests/ORM/Functional/Ticket/GH12063.php:54

Affected versions: 3.0.0 through 4.0.x

@wmouwen wmouwen force-pushed the test/gh-10788 branch 4 times, most recently from 42206e4 to 2afa331 Compare July 12, 2025 15:29
Copy link
Copy Markdown
Member

@greg0ire greg0ire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks fine but… people use enums as ID? 🤯

@greg0ire greg0ire added this to the 3.5.1 milestone Jul 14, 2025
@greg0ire greg0ire merged commit 23b74e4 into doctrine:3.5.x Jul 14, 2025
85 checks passed
@greg0ire
Copy link
Copy Markdown
Member

Thanks @wmouwen !

use Doctrine\ORM\Mapping\Id;
use Doctrine\Tests\OrmFunctionalTestCase;

class GH12063 extends OrmFunctionalTestCase
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@derrabus this test files misses a Test suffix 🤣

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants