public function testConstruct()
 {
     $router = new Router();
     $registry = new Registry($router);
     $registry->register(new Map());
     $renderer = new OpenGraphMapRenderer($registry);
     $this->assertEquals($renderer->getRegistry(), $registry);
     $this->assertEquals($renderer->getRegistry()->getRouter(), $registry->getRouter());
     return $renderer;
 }
 /**
  * @param object $entity
  * @return string
  * @throws EntityNotSupported
  */
 public function render($entity)
 {
     $this->registry->freeze();
     foreach ($this->registry->getMaps() as $map) {
         if ($map->supports($entity)) {
             $document = $this->createDocument();
             $map->map($document, $entity);
             return $document->render();
         }
     }
     throw new EntityNotSupported($entity, $this->registry);
 }
 /**
  * @depends testFreeze
  * @expectedException \Tga\OpenGraphBundle\Registry\Exception\FrozenRegistryException
  */
 public function testFreezeException(Registry $registry)
 {
     $registry->register($this->getMock('Tga\\OpenGraphBundle\\Map\\OpenGraphMapInterface'));
 }