Skip to content
Open
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
65 changes: 65 additions & 0 deletions tests/Tests/ORM/Functional/Ticket/GH11488Test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php

declare(strict_types=1);

namespace Doctrine\Tests\ORM\Functional\Ticket;

use Doctrine\ORM\Mapping\Driver\AttributeDriver;

Check failure on line 7 in tests/Tests/ORM/Functional/Ticket/GH11488Test.php

View workflow job for this annotation

GitHub Actions / coding-standards / Coding Standards (PHP: 8.4)

Type Doctrine\ORM\Mapping\Driver\AttributeDriver is not used in this file.
use Doctrine\Tests\ORM\Functional\Ticket\GH11488\Somewhere\BaseEntity;
use Doctrine\Tests\ORM\Functional\Ticket\GH11488\SomewhereElse\Mother;
use Doctrine\Tests\ORM\Functional\Ticket\GH11488\YetSomewhereElse\Daughter;
use Doctrine\Tests\OrmFunctionalTestCase;

class GH11488Test extends OrmFunctionalTestCase
{
protected function setUp(): void
{
parent::setUp();

Check failure on line 17 in tests/Tests/ORM/Functional/Ticket/GH11488Test.php

View workflow job for this annotation

GitHub Actions / coding-standards / Coding Standards (PHP: 8.4)

Expected 1 line after "parent", found 0.
// $this->_em = $this->getEntityManager(mappingDriver: new AttributeDriver([], reportFieldsWhereDeclared: true));

$this->setUpEntitySchema([
BaseEntity::class,
Mother::class,
Daughter::class,
]);
}

public function testSchema(): void
{
$cm = $this->_em->getClassMetadata(Daughter::class);

self::assertSame([0 => 'id'], $cm->getIdentifier());
self::assertSame(['id'], $cm->getFieldNames());
}
}

namespace Doctrine\Tests\ORM\Functional\Ticket\GH11488\Somewhere;

use Doctrine\ORM\Mapping as ORM;

#[ORM\MappedSuperclass]
abstract class BaseEntity
{
#[ORM\Id, ORM\Column]

Check failure on line 43 in tests/Tests/ORM/Functional/Ticket/GH11488Test.php

View workflow job for this annotation

GitHub Actions / coding-standards / Coding Standards (PHP: 8.4)

2 attributes are joined.
protected ?int $id;

Check failure on line 44 in tests/Tests/ORM/Functional/Ticket/GH11488Test.php

View workflow job for this annotation

GitHub Actions / coding-standards / Coding Standards (PHP: 8.4)

Usage of short nullable type hint in "?int" is disallowed.
}

namespace Doctrine\Tests\ORM\Functional\Ticket\GH11488\SomewhereElse;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Tests\ORM\Functional\Ticket\GH11488\Somewhere\BaseEntity;

#[ORM\MappedSuperclass]
abstract class Mother extends BaseEntity
{
}

namespace Doctrine\Tests\ORM\Functional\Ticket\GH11488\YetSomewhereElse;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Tests\ORM\Functional\Ticket\GH11488\SomewhereElse\Mother;

#[ORM\Entity]
class Daughter extends Mother
{
}
Loading