diff --git a/QA/Peardoc/Coverage.php b/QA/Peardoc/Coverage.php index dfea02b..3c78520 100644 --- a/QA/Peardoc/Coverage.php +++ b/QA/Peardoc/Coverage.php @@ -282,7 +282,7 @@ protected function loadXmlDocument($strManualPath) /** * Returns a list of packages and their paths * - * @param string $strPearDir PEAR CVS directory + * @param string $strPearDir PEAR SVN directory * @return array Array with package dir as key and package name as value */ public static function getPackageList($strPearDir) @@ -293,11 +293,12 @@ public static function getPackageList($strPearDir) $strPearDir .= '/'; } foreach ( - glob($strPearDir . '*/packag{e,e2}.xml', GLOB_BRACE) + glob($strPearDir . '*/trunk/packag{e,e2}.xml', GLOB_BRACE) as $strPackageFilePath ) { - $strPackageDir = substr($strPackageFilePath, 0, strrpos($strPackageFilePath, '/')); - + $strPackageDir = substr( + $strPackageFilePath, 0, strrpos($strPackageFilePath, '/', -15) + ); $arPackages[$strPackageDir] = basename($strPackageDir); } diff --git a/tests/QA_Peardoc_CoverageTest.php b/tests/QA_Peardoc_CoverageTest.php index f978b41..f546d48 100644 --- a/tests/QA_Peardoc_CoverageTest.php +++ b/tests/QA_Peardoc_CoverageTest.php @@ -72,7 +72,9 @@ public function testRenderCoverage() { */ public function testGetPackageList() { $ar = QA_Peardoc_Coverage::getPackageList($this->strPearDir); - $this->assertTrue(in_array('Auth' , $ar)); + $this->assertTrue( + in_array('Auth', $ar), 'Auth is not in the package list' + ); $this->assertTrue(in_array('LiveUser' , $ar)); $this->assertTrue(in_array('System_Folders' , $ar)); $this->assertTrue(in_array('Testing_Selenium' , $ar)); diff --git a/tests/QA_Peardoc_Coverage_ClassListTest.php b/tests/QA_Peardoc_Coverage_ClassListTest.php index 5db365a..853a7d4 100644 --- a/tests/QA_Peardoc_Coverage_ClassListTest.php +++ b/tests/QA_Peardoc_Coverage_ClassListTest.php @@ -55,7 +55,11 @@ protected function tearDown() { public function testAuth() { - $strAuthDir = $this->strPearDir . '/Auth'; + $strAuthDir = $this->strPearDir . '/Auth/trunk'; + if (!file_exists($strAuthDir)) { + //magic trunk-only checkout + $strAuthDir = $this->strPearDir . '/Auth'; + } $this->assertTrue(file_exists($strAuthDir)); $ar = QA_Peardoc_Coverage_ClassList::getFileList($strAuthDir, false); @@ -77,7 +81,11 @@ public function testAuth() public function testMDB2() { - $strMdb2Dir = $this->strPearDir . '/MDB2'; + $strMdb2Dir = $this->strPearDir . '/MDB2/trunk'; + if (!file_exists($strMdb2Dir)) { + //magic trunk-only checkout + $strMdb2Dir = $this->strPearDir . '/MDB2'; + } $this->assertTrue(file_exists($strMdb2Dir)); $ar = QA_Peardoc_Coverage_ClassList::getFileList($strMdb2Dir, false); @@ -100,7 +108,11 @@ public function testMDB2() public function testNetWifi() { - $strNetWifiDir = $this->strPearDir . '/Net_Wifi'; + $strNetWifiDir = $this->strPearDir . '/Net_Wifi/trunk'; + if (!file_exists($strNetWifiDir)) { + //magic trunk-only checkout + $strNetWifiDir = $this->strPearDir . '/Net_Wifi'; + } $this->assertTrue(file_exists($strNetWifiDir)); $ar = QA_Peardoc_Coverage_ClassList::getFileList($strNetWifiDir, false); diff --git a/tests/QA_Peardoc_Coverage_MethodListTest.php b/tests/QA_Peardoc_Coverage_MethodListTest.php index e5ff036..f11a237 100644 --- a/tests/QA_Peardoc_Coverage_MethodListTest.php +++ b/tests/QA_Peardoc_Coverage_MethodListTest.php @@ -55,7 +55,10 @@ protected function tearDown() { * */ public function testGetMethodsAuth() { - $strAuthDir = $this->strPearDir . '/Auth'; + $strAuthDir = $this->strPearDir . '/Auth/trunk'; + if (!file_exists($strAuthDir)) { + $strAuthDir = $this->strPearDir . '/Auth'; + } $strAuthFile = $strAuthDir . '/Auth.php'; $this->assertTrue(file_exists($strAuthFile)); @@ -70,7 +73,10 @@ public function testGetMethodsAuth() { * */ public function testGetMethodsMDB2() { - $strMdb2Dir = $this->strPearDir . '/MDB2'; + $strMdb2Dir = $this->strPearDir . '/MDB2/trunk'; + if (!file_exists($strMdb2Dir)) { + $strMdb2Dir = $this->strPearDir . '/MDB2'; + } $strMdb2File = $strMdb2Dir. '/MDB2.php'; $this->assertTrue(file_exists($strMdb2File)); diff --git a/tests/config.php b/tests/config.php index 950e48c..774f600 100644 --- a/tests/config.php +++ b/tests/config.php @@ -1,6 +1,6 @@ dirname(__FILE__) . '/../../../peardoc/manual.xml', - 'PearDir' => dirname(__FILE__) . '/../../', + 'PearDir' => dirname(__FILE__) . '/../../../', ); ?> \ No newline at end of file