$this->
addMenuLink('test3', 'test2'
);
$this->
addMenuLink('test4', ''
);
$this->
addMenuLink('test5', 'test4'
);
$this->
addMenuLink('test6', 'test5'
);
$this->
assertMenuLink('test1',
['has_children' => 1, 'depth' => 1
],
[],
['test2', 'test3'
]);
$this->
assertMenuLink('test2',
['has_children' => 1, 'depth' => 2
],
['test1'
],
['test3'
]);
$this->
assertMenuLink('test4',
['has_children' => 1, 'depth' => 1
],
[],
['test5', 'test6'
]);
$this->
assertMenuLink('test5',
['has_children' => 1, 'depth' => 2
],
['test4'
],
['test6'
]);
$this->
assertMenuLink('test6',
['has_children' => 0, 'depth' => 3
],
['test5', 'test4'
]);
$this->
moveMenuLink('test2', 'test5'
);
// After the 1st move.
// <tools>
// - test1
// - test4
// -- test5
// --- test2
// ---- test3
// --- test6
$this->
assertMenuLink('test1',
['has_children' => 0, 'depth' => 1
]);
$this->
assertMenuLink('test2',
['has_children' => 1, 'depth' => 3
],
['test5', 'test4'
],
['test3'
]);