public function testNestedGetValueByPath() { $dataSet = new DataSet(); $dataSet->push('level1'); $dataSet->setValue('foo', 'bar'); $this->assertEquals('bar', $dataSet->getValueByPath(['level1', 'foo'], true)); }
/** * @covers Binary\DataSet::getValueByPath */ public function testRelativeMultipleParentNestedGetValueByPath() { $dataSet = new DataSet(); $dataSet->push('level1'); $dataSet->setValue('foo', 'bar'); $dataSet->push('level2'); $dataSet->setValue('zoo', 'far'); $dataSet->push('level3'); $dataSet->setValue('fur', 'aff'); $this->assertEquals('aff', $dataSet->getValueByPath(array('fur'), false)); $this->assertEquals('bar', $dataSet->getValueByPath(array('..', '..', 'foo'), false)); }