Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #825 from Tobion/patch-1
Better error message when missing entity mapping
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Doctrine\Bundle\DoctrineBundle\Tests\Repository; | ||
|
||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; | ||
use Doctrine\Common\Persistence\ManagerRegistry; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class ServiceEntityRepositoryTest extends TestCase | ||
{ | ||
/** | ||
* @expectedException \LogicException | ||
* @expectedExceptionMessage Could not find the entity manager for class "Doctrine\Bundle\DoctrineBundle\Tests\Repository\TestEntity". Check your Doctrine configuration to make sure it is configured to load this entity’s metadata. | ||
*/ | ||
public function testConstructorThrowsExceptionWhenNoManagerFound() | ||
{ | ||
$registry = $this->getMockBuilder(ManagerRegistry::class)->getMock(); | ||
new ServiceEntityRepository($registry, TestEntity::class); | ||
} | ||
} |