Exemplo n.º 1
0
 /**
  * @covers Binary\DataSet::getValueByPath
  */
 public function testNestedGetValueByPath()
 {
     $dataSet = new DataSet();
     $dataSet->push('level1');
     $dataSet->setValue('foo', 'bar');
     $this->assertEquals('bar', $dataSet->getValueByPath(array('level1', 'foo'), true));
 }
Exemplo n.º 2
0
 /**
  * @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));
 }
Exemplo n.º 3
0
 /**
  * @dataProvider invalidPaths
  * @expectedException \Zerg\Field\ConfigurationException
  */
 public function testParsePathException($currentPath, $pathString)
 {
     $dataSet = new DataSet();
     foreach ($currentPath as $part) {
         $dataSet->push($part);
     }
     $dataSet->parsePath($pathString);
 }