Skip to content
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

Add regression test for #8108 #11523

Draft
wants to merge 1 commit into
base: 3.2.x
Choose a base branch
from
Draft
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
57 changes: 57 additions & 0 deletions tests/Tests/ORM/Functional/Ticket/Issue8108Test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php

declare(strict_types=1);

namespace Doctrine\Tests\ORM\Functional\Ticket;

use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\DiscriminatorMap;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\Id;
use Doctrine\ORM\Mapping\InheritanceType;
use Doctrine\ORM\Mapping\ManyToOne;
use Doctrine\Tests\OrmFunctionalTestCase;

class Issue8108Test extends OrmFunctionalTestCase
{
public function testIssue(): void
{
$this->createSchemaForModels(
Issue8108User::class,
Issue8108Base::class,
Issue8108Extending::class,
);
}
}

#[Entity]
class Issue8108User
{
public function __construct(
#[Id]
#[Column]
public int $id,
) {
}
}

abstract class Issue8108WithRelation
{
#[ManyToOne(targetEntity: Issue8108User::class)]
public Issue8108User|null $createdBy;
}

#[Entity]
#[InheritanceType('SINGLE_TABLE')]
#[DiscriminatorMap(['extending' => Issue8108Extending::class])]
abstract class Issue8108Base extends Issue8108WithRelation
{
#[Id]
#[Column]
public int $id;
}

#[Entity]
class Issue8108Extending extends Issue8108Base
{
}
Loading