コード例 #1
0
ファイル: PearTest.php プロジェクト: tpc2/phprack
 public function testGetPackageRawInfo()
 {
     try {
         $package = $this->_adapter->getPackage('PEAR');
         $package->getRawInfo();
     } catch (Exception $e) {
         $this->markTestSkipped($e->getMessage());
     }
 }
コード例 #2
0
ファイル: Pear.php プロジェクト: nnevala/zf-boilerplate
 /**
  * Show full list of installed packages
  *
  * @return $this
  * @see PearTest::testShowPearPackages()
  */
 public function showList()
 {
     try {
         $packages = $this->_pear->getAllPackages();
         $this->_log("Installed PEAR packages:");
         foreach ($packages as $package) {
             $this->_log($package->getRawInfo());
         }
     } catch (Exception $e) {
         $this->_failure("PEAR problem: {$e->getMessage()}");
     }
     return $this;
 }
コード例 #3
0
ファイル: Pear.php プロジェクト: tpc2/phprack
 /**
  * Validate version.
  *
  * @return void
  * @see exactly()
  * @see atLeast()
  */
 protected function _validateVersion($required, $comparison = '=')
 {
     if (is_null($this->_package)) {
         $this->_failure("PEAR package is absent, can't compare versions");
         return $this;
     }
     $currentVersion = $this->_package->getVersion();
     if (version_compare($currentVersion, $required, $comparison)) {
         $this->_success("PEAR '{$this->_package->getName()}' package version is '{$currentVersion}'");
     } else {
         $this->_failure(sprintf("PEAR '%s' package version is '%s', but '%s' is required (%s)", $this->_package->getName(), $currentVersion, $required, $comparison));
     }
     return $this;
 }