Skip to content

Commit

Permalink
Fix compatibility with older versions
Browse files Browse the repository at this point in the history
Older versions of PHP does not support the current implementation
so I changed it. Also in order to be able to run the test suite with
old versions of Doctrine, this change was also required (because
the interface differ).
  • Loading branch information
Nek- committed Oct 12, 2018
1 parent 76cf83f commit 9d3a0a6
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions Tests/Repository/ContainerRepositoryFactoryTest.php
Expand Up @@ -88,7 +88,7 @@ public function testServiceRepositoriesCanNotExtendsEntityRepository()
$this->markTestSkipped('Symfony 3.3 is needed for this feature.');
}

$repo = new StubCustomRepository();
$repo = $this->getMockBuilder(ObjectRepository::class)->getMock();

$container = $this->createContainer(['my_repo' => $repo]);

Expand All @@ -97,7 +97,7 @@ public function testServiceRepositoriesCanNotExtendsEntityRepository()
$factory = new ContainerRepositoryFactory($container);
$factory->getRepository($em, 'Foo\CoolEntity');
$actualRepo = $factory->getRepository($em, 'Foo\CoolEntity');
$this->assertInstanceOf(StubCustomRepository::class, $actualRepo);
$this->assertSame($repo, $actualRepo);
}


Expand Down Expand Up @@ -189,12 +189,3 @@ class StubRepository extends EntityRepository
class StubServiceRepository extends EntityRepository implements ServiceEntityRepositoryInterface
{
}

class StubCustomRepository implements ObjectRepository
{
public function find($id) {}
public function findAll() {}
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null) {}
public function findOneBy(array $criteria) {}
public function getClassName() {}
}

0 comments on commit 9d3a0a6

Please sign in to comment.