/** * @covers Navinator\Collection::call */ public function testCall() { $nodeData = array('alpha/beta/gamma/delta' => 4, 'alpha/beta' => 2, 'alpha' => 1, 'alpha/beta/gamma' => 3); $nodes = array(); $c = new Collection(); foreach ($nodeData as $path => $expectedDepth) { $n = new Node($path); $nodes[$path] = $n; $c->addNode($n); } $pathArray = $c->call('getPath'); $this->assertEquals($pathArray, array_keys($nodeData)); $depthArray = $c->call('getDepth'); $this->assertEquals($depthArray, array_values($nodeData)); }