$pkg->_packageInfo['version']['release'] = $version;
$pkg->setDate(date('Y-m-d'));
$pkg->setTime(date('H:i:s'));
+ $errors = array();
ob_start();
$old_dir = getcwd();
chdir($archive_dir);
- $result = Components_Exception_Pear::catchError(
- $pkg->getDefaultGenerator()
- ->toTgz(new PEAR_Common())
- );
+ try {
+ $result = Components_Exception_Pear::catchError(
+ $pkg->getDefaultGenerator()->toTgz(new PEAR_Common())
+ );
+ } catch (Components_Exception_Pear $e) {
+ $errors[] = $e->getMessage();
+ $errors[] = '';
+ $result = false;
+ foreach ($pkg->getValidationWarnings() as $error) {
+ $errors[] = isset($error['message']) ? $error['message'] : 'Unknown Error';
+ }
+ }
chdir($old_dir);
$this->_output->pear(ob_get_clean());
- $this->_output->ok('Generated snapshot ' . $result);
+ if ($result) {
+ $this->_output->ok('Generated snapshot ' . $result);
+ } else {
+ $this->_output->fail(
+ 'Generating snapshot failed with:'. "\n\n" . join("\n", $errors)
+ );
+ }
return $result;
}
{
$this->given('the default Components setup')
->when('calling the package with the devpackage option, the archive directory option and a path to an invalid Horde framework component')
- ->then('the output should indicate an invalid package.xml');
+ ->then('the output should indicate an invalid package.xml')
+ ->and('indicate the specific problem of the package.xml');
}
}
\ No newline at end of file
$world['output']
);
break;
+ case 'indicate the specific problem of the package.xml':
+ $this->assertContains(
+ 'Old.php" in package.xml does not exist',
+ $world['output']
+ );
+ break;
default:
return $this->notImplemented($action);
}
private function _callUnstrict(array $parameters)
{
- $old_errorreporting = error_reporting(E_ALL & ~E_STRICT);
+ $old_errorreporting = error_reporting(E_ALL & ~(E_STRICT | E_DEPRECATED));
+ error_reporting(E_ALL & ~(E_STRICT | E_DEPRECATED));
$this->_callStrict($parameters);
error_reporting($old_errorreporting);
}
'*' => false,
);
$GLOBALS['_PEAR_ERRORSTACK_DEFAULT_LOGGER'] = false;
+ $GLOBALS['_PEAR_ERRORSTACK_OVERRIDE_CALLBACK'] = array();
}
}
\ No newline at end of file