function _checkProperNesting($nodes, $line = '') { $this->assertEqual(lmbArrayHelper::sortArray($nodes, array('path' => 'ASC')), $nodes); $path = lmbArrayHelper::getMinColumnValue('path', $nodes, $index); $parent_paths[] = $this->_getParentPath($path); $counter = 0; foreach ($nodes as $id => $node) { $parent_path = $this->_getParentPath($node['path']); $this->assertTrue(in_array($parent_path, $parent_paths), 'path is improperly nested: ' . $node['path'] . ' , expected parent not found: ' . $parent_path . ' at line: ' . $line); $parent_paths[] = $node['path']; } }
function testGetMinColumnValue() { $arr = array(array('foo' => 1), array('foo' => 2)); $this->assertEqual(lmbArrayHelper::getMinColumnValue('foo', $arr, $pos), 1); $this->assertEqual($pos, 0); }