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

Update dependency doctrine/persistence to ^1.3 || ^2.0 || ^3.0 #381

Merged
merged 2 commits into from
Sep 30, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"doctrine/dbal": "^3.2",
"doctrine/event-manager": "^1.0",
"doctrine/orm": "^2.10",
"doctrine/persistence": "^1.3 || ^2.0",
"doctrine/persistence": "^1.3 || ^2.0 || ^3.0",
"symfony/property-access": "^5.4 || ^6.0",
"symfony/uid": "^5.4 || ^6.0"
},
Expand Down
10 changes: 0 additions & 10 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,6 @@ parameters:
count: 1
path: tests/Fixtures/DemoEntityManager.php

-
message: "#^Parameter \\#1 \\$className of method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getRepository\\(\\) expects class\\-string\\<object\\>, string given\\.$#"
count: 1
path: tests/Fixtures/DemoEntityManager.php

-
message: "#^Unable to resolve the template type T in call to method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getRepository\\(\\)$#"
count: 1
path: tests/Fixtures/DemoEntityManager.php

-
message: "#^Call to function method_exists\\(\\) with Doctrine\\\\DBAL\\\\Connection and 'createSchemaManager' will always evaluate to true\\.$#"
count: 1
Expand Down
7 changes: 4 additions & 3 deletions tests/Adapter/ORM/EntityManagerTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Doctrine\Persistence\ManagerRegistry;
use Doctrine\Persistence\ObjectManager;
use Nucleos\Doctrine\Tests\Fixtures\DemoEntityManager;
use Nucleos\Doctrine\Tests\Fixtures\EmptyClass;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;

Expand All @@ -33,16 +34,16 @@ public function testCreateQueryBuilder(): void
;

$objectManager = $this->prophesize(ObjectManager::class);
$objectManager->getRepository('foo')
$objectManager->getRepository(EmptyClass::class)
->willReturn($repository)
;

$registry = $this->prophesize(ManagerRegistry::class);
$registry->getManagerForClass('foo')
$registry->getManagerForClass(EmptyClass::class)
->willReturn($objectManager)
;

$manager = new DemoEntityManager('foo', $registry->reveal());
$manager = new DemoEntityManager(EmptyClass::class, $registry->reveal());

static::assertSame($queryBuilder->reveal(), $manager->getQueryBuilder('alias', 'someindex'));
}
Expand Down
5 changes: 4 additions & 1 deletion tests/Fixtures/DemoEntityManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@ final class DemoEntityManager
private $registry;

/**
* @var string
* @var class-string
*/
private $class;

/**
* @param class-string $class
*/
public function __construct(string $class, ManagerRegistry $registry)
{
$this->registry = $registry;
Expand Down
7 changes: 4 additions & 3 deletions tests/Manager/ORM/BaseQueryTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Doctrine\Persistence\ManagerRegistry;
use Doctrine\Persistence\ObjectManager;
use Nucleos\Doctrine\Tests\Fixtures\DemoEntityManager;
use Nucleos\Doctrine\Tests\Fixtures\EmptyClass;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;

Expand All @@ -33,16 +34,16 @@ protected function setUp(): void
$repository = $this->prophesize(EntityRepository::class);

$objectManager = $this->prophesize(ObjectManager::class);
$objectManager->getRepository('foo')
$objectManager->getRepository(EmptyClass::class)
->willReturn($repository)
;

$registry = $this->prophesize(ManagerRegistry::class);
$registry->getManagerForClass('foo')
$registry->getManagerForClass(EmptyClass::class)
->willReturn($objectManager)
;

$this->manager = new DemoEntityManager('foo', $registry->reveal());
$this->manager = new DemoEntityManager(EmptyClass::class, $registry->reveal());
}

public function testAddOrder(): void
Expand Down
7 changes: 4 additions & 3 deletions tests/Manager/ORM/SearchQueryTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Doctrine\Persistence\ManagerRegistry;
use Doctrine\Persistence\ObjectManager;
use Nucleos\Doctrine\Tests\Fixtures\DemoEntityManager;
use Nucleos\Doctrine\Tests\Fixtures\EmptyClass;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ObjectProphecy;
Expand All @@ -36,16 +37,16 @@ protected function setUp(): void
$repository = $this->prophesize(EntityRepository::class);

$objectManager = $this->prophesize(ObjectManager::class);
$objectManager->getRepository('foo')
$objectManager->getRepository(EmptyClass::class)
->willReturn($repository)
;

$registry = $this->prophesize(ManagerRegistry::class);
$registry->getManagerForClass('foo')
$registry->getManagerForClass(EmptyClass::class)
->willReturn($objectManager)
;

$this->manager = new DemoEntityManager('foo', $registry->reveal());
$this->manager = new DemoEntityManager(EmptyClass::class, $registry->reveal());
}

public function testSearchWhere(): void
Expand Down