|
@@ 74-84 (lines=11) @@
|
| 71 |
|
/** |
| 72 |
|
* @expectedException \RuntimeException |
| 73 |
|
*/ |
| 74 |
|
public function testThatGetRepositoryThrowsExceptionIfEntityNotConfigured() |
| 75 |
|
{ |
| 76 |
|
$finderMock = $this->createFinderMock(); |
| 77 |
|
$readerMock = $this->createReaderMock(); |
| 78 |
|
|
| 79 |
|
$entityName = 'FOS\ElasticaBundle\Tests\Manager\Entity'; |
| 80 |
|
|
| 81 |
|
$manager = new RepositoryManager($readerMock); |
| 82 |
|
$manager->addEntity($entityName, $finderMock); |
| 83 |
|
$manager->getRepository('Missing Entity'); |
| 84 |
|
} |
| 85 |
|
|
| 86 |
|
/** |
| 87 |
|
* @expectedException \RuntimeException |
|
@@ 89-99 (lines=11) @@
|
| 86 |
|
/** |
| 87 |
|
* @expectedException \RuntimeException |
| 88 |
|
*/ |
| 89 |
|
public function testThatGetRepositoryThrowsExceptionIfCustomRepositoryNotFound() |
| 90 |
|
{ |
| 91 |
|
$finderMock = $this->createFinderMock(); |
| 92 |
|
$readerMock = $this->createReaderMock(); |
| 93 |
|
|
| 94 |
|
$entityName = 'FOS\ElasticaBundle\Tests\Manager\Entity'; |
| 95 |
|
|
| 96 |
|
$manager = new RepositoryManager($readerMock); |
| 97 |
|
$manager->addEntity($entityName, $finderMock, 'FOS\ElasticaBundle\Tests\MissingRepository'); |
| 98 |
|
$manager->getRepository('FOS\ElasticaBundle\Tests\Manager\Entity'); |
| 99 |
|
} |
| 100 |
|
|
| 101 |
|
/** |
| 102 |
|
* @expectedException \RuntimeException |
|
@@ 104-114 (lines=11) @@
|
| 101 |
|
/** |
| 102 |
|
* @expectedException \RuntimeException |
| 103 |
|
*/ |
| 104 |
|
public function testThatGetRepositoryThrowsExceptionIfEntityDoesNotExist() |
| 105 |
|
{ |
| 106 |
|
$finderMock = $this->createFinderMock(); |
| 107 |
|
$readerMock = $this->createReaderMock(); |
| 108 |
|
|
| 109 |
|
$entityName = 'FOS\ElasticaBundle\Tests\Manager\Entity'; |
| 110 |
|
|
| 111 |
|
$manager = new RepositoryManager($readerMock); |
| 112 |
|
$manager->addEntity($entityName, $finderMock, 'FOS\ElasticaBundle\Tests\MissingRepository'); |
| 113 |
|
$manager->getRepository('Missing Entity'); |
| 114 |
|
} |
| 115 |
|
|
| 116 |
|
public function testThatGetRepositoryCachesRepositoryInstances() |
| 117 |
|
{ |