|
@@ 45-56 (lines=12) @@
|
| 42 |
|
return $readerMock; |
| 43 |
|
} |
| 44 |
|
|
| 45 |
|
public function testThatGetRepositoryReturnsDefaultRepository() |
| 46 |
|
{ |
| 47 |
|
$finderMock = $this->createFinderMock(); |
| 48 |
|
$readerMock = $this->createReaderMock(); |
| 49 |
|
|
| 50 |
|
$entityName = 'FOS\ElasticaBundle\Tests\Manager\Entity'; |
| 51 |
|
|
| 52 |
|
$manager = new RepositoryManager($readerMock); |
| 53 |
|
$manager->addEntity($entityName, $finderMock); |
| 54 |
|
$repository = $manager->getRepository($entityName); |
| 55 |
|
$this->assertInstanceOf('FOS\ElasticaBundle\Repository', $repository); |
| 56 |
|
} |
| 57 |
|
|
| 58 |
|
public function testThatGetRepositoryReturnsCustomRepository() |
| 59 |
|
{ |
|
@@ 58-69 (lines=12) @@
|
| 55 |
|
$this->assertInstanceOf('FOS\ElasticaBundle\Repository', $repository); |
| 56 |
|
} |
| 57 |
|
|
| 58 |
|
public function testThatGetRepositoryReturnsCustomRepository() |
| 59 |
|
{ |
| 60 |
|
$finderMock = $this->createFinderMock(); |
| 61 |
|
$readerMock = $this->createReaderMock(); |
| 62 |
|
|
| 63 |
|
$entityName = 'FOS\ElasticaBundle\Tests\Manager\Entity'; |
| 64 |
|
|
| 65 |
|
$manager = new RepositoryManager($readerMock); |
| 66 |
|
$manager->addEntity($entityName, $finderMock, 'FOS\ElasticaBundle\Tests\Manager\CustomRepository'); |
| 67 |
|
$repository = $manager->getRepository($entityName); |
| 68 |
|
$this->assertInstanceOf('FOS\ElasticaBundle\Tests\Manager\CustomRepository', $repository); |
| 69 |
|
} |
| 70 |
|
|
| 71 |
|
/** |
| 72 |
|
* @expectedException \RuntimeException |