public function testCanRemoveFromNestedStructure() { $param1 = new Parameter(array('name' => 'parent')); $param2 = new Parameter(array('name' => 'child')); $param1->addProperty($param2); $this->assertSame($param1, $param2->getParent()); $this->assertSame($param2, $param1->getProperty('child')); // Remove a single child from the structure $param1->removeProperty('child'); $this->assertNull($param1->getProperty('child')); // Remove the entire structure $param1->addProperty($param2); $param1->removeProperty('child'); $this->assertNull($param1->getProperty('child')); }