/**
* @scenario
*/
- public function theDevPackageModuleAddsTheDOptionInTheHelpOutput()
+ public function testOption()
{
$this->given('the default Components setup')
->when('calling the package with the help option')
/**
* @scenario
*/
- public function theTheLowerCaseDOptionGeneratesAPackageSnapshot()
+ public function testSnapshotGeneration()
{
$this->given('the default Components setup')
->when('calling the package with the devpackage option, the archive directory option and a path to a Horde framework component')
->then('a package snapshot will be generated at the indicated archive directory');
}
+
+ /**
+ * @scenario
+ */
+ public function testErrorHandling()
+ {
+ $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');
+ }
}
\ No newline at end of file
);
$world['output'] = $this->_callUnstrictComponents();
break;
+ case 'calling the package with the devpackage option, the archive directory option and a path to an invalid Horde framework component':
+ $this->_setPearGlobals();
+ $_SERVER['argv'] = array(
+ 'horde-components',
+ '--verbose',
+ '--devpackage',
+ '--archivedir=' . $this->_getTemporaryDirectory(),
+ dirname(__FILE__) . '/fixture/simple'
+ );
+ try {
+ $world['output'] = $this->_callUnstrictComponents();
+ } catch (Components_Exception_Pear $e) {
+ ob_end_clean();
+ $world['output'] = (string) $e;
+ }
+ break;
case 'calling the package with the distribute option and a path to a Horde framework component':
$_SERVER['argv'] = array(
'horde-components',
)
);
break;
+ case 'the output should indicate an invalid package.xml':
+ $this->assertContains(
+ 'PEAR_Packagefile_v2::toTgz: invalid package.xml',
+ $world['output']
+ );
+ break;
default:
return $this->notImplemented($action);
}
{
Components::main($parameters);
}
+
+ private function _setPearGlobals()
+ {
+ $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_CALLBACK'] = array(
+ '*' => false,
+ );
+ $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_LOGGER'] = false;
+ }
}
\ No newline at end of file