public function testGetEntity()
 {
     $entityKey = 'test1';
     $entity = new \stdClass();
     $this->templateRepository->expects($this->once())->method('createEntity')->with($entityKey)->will($this->returnValue($entity));
     // test that new entity is created
     $this->assertSame($entity, $this->templateRepository->getEntity($entityKey));
     $this->assertSame($entity, $this->entityRegistry->getEntity(self::ENTITY_CLASS, $entityKey));
     // test that existing entity is returned
     $this->assertSame($entity, $this->templateRepository->getEntity($entityKey));
     $this->assertSame($entity, $this->entityRegistry->getEntity(self::ENTITY_CLASS, $entityKey));
 }