You are here

class ManagerRegistryTest in Plug 7

@groups DCOM-270 @uses Doctrine\Tests\Common\Persistence\TestObject

Hierarchy

  • class \Doctrine\Tests\Common\Persistence\ManagerRegistryTest extends \Doctrine\Tests\DoctrineTestCase

Expanded class hierarchy of ManagerRegistryTest

File

lib/doctrine/common/tests/Doctrine/Tests/Common/Persistence/ManagerRegistryTest.php, line 14

Namespace

Doctrine\Tests\Common\Persistence
View source
class ManagerRegistryTest extends DoctrineTestCase {

  /**
   * @var TestManagerRegistry
   */
  private $mr;

  /**
   * {@inheritdoc}
   */
  public function setUp() {
    $this->mr = new TestManagerRegistry('ORM', array(
      'default_connection',
    ), array(
      'default_manager',
    ), 'default', 'default', 'Doctrine\\Common\\Persistence\\ObjectManagerAware');
  }
  public function testGetManagerForClass() {
    $this->mr
      ->getManagerForClass('Doctrine\\Tests\\Common\\Persistence\\TestObject');
  }
  public function testGetManagerForInvalidClass() {
    $this
      ->setExpectedException('ReflectionException', 'Class Doctrine\\Tests\\Common\\Persistence\\TestObjectInexistent does not exist');
    $this->mr
      ->getManagerForClass('prefix:TestObjectInexistent');
  }
  public function testGetManagerForAliasedClass() {
    $this->mr
      ->getManagerForClass('prefix:TestObject');
  }
  public function testGetManagerForInvalidAliasedClass() {
    $this
      ->setExpectedException('ReflectionException', 'Class Doctrine\\Tests\\Common\\Persistence\\TestObject:Foo does not exist');
    $this->mr
      ->getManagerForClass('prefix:TestObject:Foo');
  }

}

Members