function configurePathFinder(PathFinder $finder) { if ($this->pathfinderAlgorithm) { $finder->setAlgorithm($this->pathfinderAlgorithm); } if ($this->pathfinderMaxDepth) { $finder->setMaxDepth($this->pathfinderMaxDepth); } }
function testPathFinderMaxDepthAndAlgorithm() { $configuration = new Configuration(array('pathfinder_maxdepth' => 5, 'pathfinder_algorithm' => PathFinderImpl::AlgoAllSimple)); $finder = new PathFinder(); $configuration->configurePathFinder($finder); $expect = new PathFinder(); $expect->setMaxDepth(5); $expect->setAlgorithm(PathFinderImpl::AlgoAllSimple); $this->assertEquals($expect, $finder); }