/** * @covers Navinator\Collection::getOrphanNodes */ public function testGetOrphanNodes() { $nodeData = array('alpha/beta', 'alpha/beta/gama', 'alpha/beta-2/gama', 'test', 'test/beta', 'test/beta/gama'); $nodes = array(); $c = new Collection(); foreach ($nodeData as $path) { $n = new Node($path); $nodes[$path] = $n; $c->addNode($n); } $orphans = $c->getOrphanNodes(); $expected = array('alpha/beta' => $nodes['alpha/beta'], 'alpha/beta-2/gama' => $nodes['alpha/beta-2/gama']); $this->assertEquals($expected, $orphans); }