assertEquals('/foo/bar', $concept->getPath()); } public function testNarrowCheck() { $parent = new Concept('/foo'); $child = new Concept('/foo/bar'); $this->assertFalse($parent->isNarrowerThan($child)); $this->assertTrue($child->isNarrowerThan($parent)); $other = new Concept('/other/bar'); $this->assertFalse($other->isNarrowerThan($child)); } public function testNarrowConceptPruning() { $concepts = [ new Concept('/foo'), new Concept('/fooo'), new Concept('/foo/baz'), new Concept('/bar/baz'), new Concept('/bar'), ]; $pruned = Concept::pruneNarrowConcepts($concepts); $expected = [ new Concept('/bar'), new Concept('/foo'), new Concept('/fooo'), ]; $this->assertEquals($expected, $pruned); } }