/** * Tests getting the parent of a node. * * @group JNode * @covers JNode::getParent * @return void */ public function testGetParent() { $this->assertEquals(null, $this->object->getParent(), 'New node should have null parent'); $this->assertAttributeEquals(null, '_parent', $this->object); $newParent = new JNode(); $newParent->addChild($this->object); $this->assertEquals($newParent, $this->object->getParent(), 'Node should have this parent'); $this->assertAttributeEquals($newParent, '_parent', $this->object); }