Skip to content

Commit

Permalink
CloCkWeRX pokes cweiske with QA_Peardoc_Coverage_MethodListTest failu…
Browse files Browse the repository at this point in the history
  • Loading branch information
cweiske committed Aug 1, 2009
1 parent bd1f3e8 commit 991fce0
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 11 deletions.
9 changes: 5 additions & 4 deletions QA/Peardoc/Coverage.php
Expand Up @@ -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)
Expand All @@ -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);
}

Expand Down
4 changes: 3 additions & 1 deletion tests/QA_Peardoc_CoverageTest.php
Expand Up @@ -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));
Expand Down
18 changes: 15 additions & 3 deletions tests/QA_Peardoc_Coverage_ClassListTest.php
Expand Up @@ -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);

Expand All @@ -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);

Expand All @@ -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);

Expand Down
10 changes: 8 additions & 2 deletions tests/QA_Peardoc_Coverage_MethodListTest.php
Expand Up @@ -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));

Expand All @@ -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));

Expand Down
2 changes: 1 addition & 1 deletion tests/config.php
@@ -1,6 +1,6 @@
<?php
$GLOBALS['testConfig'] = array(
'ManualPath' => dirname(__FILE__) . '/../../../peardoc/manual.xml',
'PearDir' => dirname(__FILE__) . '/../../',
'PearDir' => dirname(__FILE__) . '/../../../',
);
?>

0 comments on commit 991fce0

Please sign in to comment.