/**
  * Test that children are retrieved in the parent locale
  */
 public function testFindTranslationWithUntranslatedChildren()
 {
     $this->dm->persist($this->doc);
     $this->dm->bindTranslation($this->doc, 'en');
     $this->doc->topic = 'Un autre sujet';
     $this->dm->bindTranslation($this->doc, 'fr');
     $this->dm->flush();
     $testNode = $this->node->getNode($this->testNodeName);
     $testNode->addNode('new-comment');
     $this->session->save();
     $this->dm->clear();
     $this->doc = $this->dm->findTranslation($this->class, '/functional/' . $this->testNodeName, 'fr');
     $this->assertEquals('fr', $this->doc->locale);
     $children = $this->doc->getChildren();
     $this->assertCount(1, $children);
     foreach ($children as $comment) {
         $this->assertInstanceOf('Doctrine\\ODM\\PHPCR\\Document\\Generic', $comment);
         $this->assertNull($this->dm->getUnitOfWork()->getCurrentLocale($comment));
     }
     $this->dm->clear();
     $this->doc = $this->dm->findTranslation($this->class, '/functional/' . $this->testNodeName, 'en');
     $children = $this->dm->getChildren($this->doc);
     $this->assertCount(1, $children);
     foreach ($children as $comment) {
         $this->assertInstanceOf('Doctrine\\ODM\\PHPCR\\Document\\Generic', $comment);
         $this->assertNull($this->dm->getUnitOfWork()->getCurrentLocale($comment));
     }
 }