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 support for doctrine/common 3 #53

Merged
merged 1 commit into from
Aug 20, 2020
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
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@
],
"require": {
"php": "^7.3",
"doctrine/common": "^2.8",
"doctrine/common": "^2.12 || ^3.0",
"doctrine/dbal": "^2.6",
"doctrine/event-manager": "^1.0",
"doctrine/orm": "^2.5",
"doctrine/persistence": "^1.3 || ^2.0",
"symfony/property-access": "^4.2 || ^5.0"
},
"conflict": {
Expand Down
10 changes: 10 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ parameters:
count: 1
path: tests/Fixtures/DemoEntityManager.php

-
message: "#^Parameter \\#1 \\$className of method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getRepository\\(\\) expects class\\-string\\<mixed\\>, 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: "#^Only booleans are allowed in a negated boolean, Doctrine\\\\Persistence\\\\ObjectManager\\|null given\\.$#"
count: 1
Expand Down
7 changes: 5 additions & 2 deletions tests/Adapter/ORM/EntityManagerTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@

namespace Nucleos\Doctrine\Tests\Adapter\ORM;

use Doctrine\Common\Persistence\ManagerRegistry;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\QueryBuilder;
use Doctrine\Persistence\ManagerRegistry;
use Doctrine\Persistence\ObjectManager;
use Nucleos\Doctrine\Tests\Fixtures\DemoEntityManager;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;

final class EntityManagerTraitTest extends TestCase
{
use ProphecyTrait;

public function testCreateQueryBuilder(): void
{
$queryBuilder = $this->prophesize(QueryBuilder::class);
Expand Down
3 changes: 3 additions & 0 deletions tests/EventListener/ORM/ConfirmableListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@
use Nucleos\Doctrine\Tests\Fixtures\EmptyClass;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use ReflectionClass;

final class ConfirmableListenerTest extends TestCase
{
use ProphecyTrait;

public function testGetSubscribedEvents(): void
{
$listener = new ConfirmableListener();
Expand Down
3 changes: 3 additions & 0 deletions tests/EventListener/ORM/DeletableListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@
use Nucleos\Doctrine\Tests\Fixtures\EmptyClass;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use ReflectionClass;

final class DeletableListenerTest extends TestCase
{
use ProphecyTrait;

public function testGetSubscribedEvents(): void
{
$listener = new DeletableListener();
Expand Down
3 changes: 3 additions & 0 deletions tests/EventListener/ORM/LifecycleDateListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@
use Nucleos\Doctrine\Tests\Fixtures\EmptyClass;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use ReflectionClass;
use stdClass;

final class LifecycleDateListenerTest extends TestCase
{
use ProphecyTrait;

public function testGetSubscribedEvents(): void
{
$listener = new LifecycleDateListener();
Expand Down
3 changes: 3 additions & 0 deletions tests/EventListener/ORM/SortableListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@
use Nucleos\Doctrine\Tests\Fixtures\EmptyClass;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use ReflectionClass;
use stdClass;

final class SortableListenerTest extends TestCase
{
use ProphecyTrait;

public function testGetSubscribedEvents(): void
{
$listener = new SortableListener();
Expand Down
3 changes: 3 additions & 0 deletions tests/EventListener/ORM/TablePrefixEventListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@
use Doctrine\ORM\Events;
use Nucleos\Doctrine\EventListener\ORM\TablePrefixEventListener;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;

final class TablePrefixEventListenerTest extends TestCase
{
use ProphecyTrait;

public function testGetSubscribedEvents(): void
{
$listener = new TablePrefixEventListener('acme_');
Expand Down
3 changes: 3 additions & 0 deletions tests/EventListener/ORM/UniqueActiveListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@
use Nucleos\Doctrine\Tests\Fixtures\EmptyClass;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;
use ReflectionClass;
use stdClass;

final class UniqueActiveListenerTest extends TestCase
{
use ProphecyTrait;

public function testGetSubscribedEvents(): void
{
$listener = new UniqueActiveListener();
Expand Down
4 changes: 2 additions & 2 deletions tests/Fixtures/DemoEntityManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@

namespace Nucleos\Doctrine\Tests\Fixtures;

use Doctrine\Common\Persistence\ManagerRegistry;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query\Expr\Composite;
use Doctrine\ORM\QueryBuilder;
use Doctrine\Persistence\ManagerRegistry;
use Doctrine\Persistence\ObjectManager;
use Nucleos\Doctrine\Adapter\ORM\EntityManagerTrait;
use Nucleos\Doctrine\Manager\ORM\BaseQueryTrait;
use Nucleos\Doctrine\Manager\ORM\SearchQueryTrait;
Expand Down
7 changes: 5 additions & 2 deletions tests/Manager/ORM/BaseQueryTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@

namespace Nucleos\Doctrine\Tests\Manager\ORM;

use Doctrine\Common\Persistence\ManagerRegistry;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\QueryBuilder;
use Doctrine\Persistence\ManagerRegistry;
use Doctrine\Persistence\ObjectManager;
use Nucleos\Doctrine\Tests\Fixtures\DemoEntityManager;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;

final class BaseQueryTraitTest extends TestCase
{
use ProphecyTrait;

/**
* @var DemoEntityManager
*/
Expand Down
7 changes: 5 additions & 2 deletions tests/Manager/ORM/SearchQueryTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,21 @@

namespace Nucleos\Doctrine\Tests\Manager\ORM;

use Doctrine\Common\Persistence\ManagerRegistry;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query\Expr;
use Doctrine\ORM\Query\Expr\Orx;
use Doctrine\ORM\QueryBuilder;
use Doctrine\Persistence\ManagerRegistry;
use Doctrine\Persistence\ObjectManager;
use Nucleos\Doctrine\Tests\Fixtures\DemoEntityManager;
use PHPUnit\Framework\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Prophecy\Prophecy\ObjectProphecy;

final class SearchQueryTraitTest extends TestCase
{
use ProphecyTrait;

/**
* @var DemoEntityManager
*/
Expand Down