Skip to content

Commit

Permalink
Add support for doctrine/common 3
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed Aug 20, 2020
1 parent 4146d63 commit 68aae8c
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 9 deletions.
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.1 || ^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

0 comments on commit 68aae8c

Please sign in to comment.