public function testExceptionThrowIfNotParent() { $computer = new RelativePathComputer(__FILE__); $this->setExpectedException('\\LogicException'); $computer->computeToParent(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Fake'); }
/** * Compute relative path from $bowerFileDirectory to the web directory * * @param string $bowerFileDirectory * @return string */ private function computeTargetDirectory($bowerFileDirectory) { $parentWebDir = dirname($this->getContainer()->getParameter('kernel.root_dir')); $relativePathComputer = new RelativePathComputer($bowerFileDirectory); return $relativePathComputer->computeToParent($parentWebDir) . 'web' . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR . 'components'; }