/** * Info array is just like the array returned from * {@link Pyrus\Developer\PackageFile\Commands::parsePackageName()} * * @return void */ public function testPear2Skeleton() { $info = array(); $info['path'] = 'Foo'; $info['mainPath'] = 'Foo'; $info['mainClass'] = 'PEAR2\\Foo\\Main'; $info['mainNamespace'] = 'PEAR2\\Foo'; $info['svn'] = 'http://svn.php.net/repository/pear2/PEAR2_Foo'; $info['package'] = $this->packageName; $skeleton = new Commands\PEAR2Skeleton($info); $skeleton->generate(); $this->assertFileExists($this->base . '/' . $info['path'] . '/src/' . $info['mainPath'] . '/Main.php'); $this->assertFileExists($this->base . '/' . $info['path'] . '/' . $skeleton->getStub()); $this->assertFileExists($this->base . '/' . $info['path'] . '/' . $skeleton->getExtraSetup()); $this->assertFileExists($this->base . '/' . $info['path'] . '/' . $skeleton->getPackageXmlSetup()); $releaseFiles = $skeleton->getReleaseFiles(); foreach ($releaseFiles as $releaseFile => $fileContent) { $this->assertFileExists($this->base . '/' . $info['path'] . '/' . $releaseFile); } }
/** * Create the PEAR2 skeleton * * @param mixed $frontend \Pyrus\ScriptFrontend\Commands * @param array $args * @param array $options * * @return void * * @uses Pyrus\Developer\PackageFile\Commands\PEAR2Skeleton * @uses self::makePackageXml() */ public function pear2Skeleton($frontend, array $args, array $options) { if (!isset($args['channel'])) { $args['channel'] = 'pear2.php.net'; } $info = $this->parsePackageName($args['package'], $args['channel']); $skeleton = new Commands\PEAR2Skeleton($info); $skeleton->generate(); $options['stub'] = $skeleton->getStub(); $options['extrasetup'] = $skeleton->getExtraSetup(); $options['packagexmlsetup'] = $skeleton->getPackageXmlSetup(); $options['package'] = false; $options['nocompatible'] = false; $this->makePackageXml($frontend, array('packagename' => $info['package'], 'channel' => $args['channel']), $options); }