/**
  * Test JComponentRouterViewconfiguration::setParent
  *
  * @return  void
  *
  * @since   3.4
  * @covers  JComponentRouterViewconfiguration::setParent
  */
 public function testSetParent()
 {
     $parent = new JComponentRouterViewconfiguration('parent');
     // View has no parent
     $this->assertEquals(false, $this->object->parent);
     $this->assertEquals(false, $this->object->parent_key);
     $this->assertEquals(array(), $this->object->children);
     $this->assertEquals(array(), $this->object->child_keys);
     $this->assertEquals(array('test'), $this->object->path);
     $this->assertEquals(array(), $parent->children);
     $this->assertEquals(array(), $parent->child_keys);
     // Assign View a parent
     $this->assertEquals($this->object, $this->object->setParent($parent));
     $this->assertEquals($parent, $this->object->parent);
     $this->assertEquals(false, $this->object->parent_key);
     $this->assertEquals(array(), $this->object->children);
     $this->assertEquals(array($this->object), $parent->children);
     $this->assertEquals(array('parent', 'test'), $this->object->path);
     $this->assertEquals(array(), $parent->child_keys);
     // Re-assign View a parent, this time with an ID
     $parent2 = new JComponentRouterViewconfiguration('category');
     $this->assertEquals($this->object, $this->object->setParent($parent2, 'catid'));
     $this->assertEquals($parent2, $this->object->parent);
     $this->assertEquals('catid', $this->object->parent_key);
     $this->assertEquals(array(), $this->object->children);
     $this->assertEquals(array($this->object), $parent2->children);
     $this->assertEquals(array('category', 'test'), $this->object->path);
     $this->assertEquals(array('catid'), $parent2->child_keys);
     // Make sure that the original parent is cleaned up
     $this->assertEquals(array(), $parent->children);
     $this->assertEquals(array(), $parent->child_keys);
     // Re-assign View a parent, again with an ID
     $parent3 = new JComponentRouterViewconfiguration('form');
     $this->assertEquals($this->object, $this->object->setParent($parent3, 'formid'));
     $this->assertEquals($parent3, $this->object->parent);
     $this->assertEquals('formid', $this->object->parent_key);
     $this->assertEquals(array('formid'), $parent3->child_keys);
     // Make sure that the original parent is cleaned up
     $this->assertEquals(array(), $parent2->children);
     $this->assertEquals(array(), $parent2->child_keys);
 }