findMagentoRootDir() public method

Given a start directory, work upwards and attempt to identify the Magento root directory. Throws an exception if it can't be found.
public findMagentoRootDir ( string $start_directory ) : string
$start_directory string
return string
Ejemplo n.º 1
0
 /**
  * @test
  * @expectedException \Exception
  */
 public function testFindMagentoRootDirNotFound()
 {
     $dir_prefix = __DIR__ . "/MagentoTest";
     $this->assertFileExists("{$dir_prefix}/a/b/app/Mage.php");
     $magento = new Magento("{$dir_prefix}/a/b");
     $this->assertFileNotExists("{$dir_prefix}/a/app/Mage.php");
     $magento->findMagentoRootDir("{$dir_prefix}/a");
 }