예제 #1
0
 public function testSetEnvironment()
 {
     $installInfo = new InstallInfo('vendor/package', '/path');
     $installInfo->setEnvironment(Environment::PROD);
     $this->assertSame(Environment::PROD, $installInfo->getEnvironment());
 }
예제 #2
0
파일: Package.php 프로젝트: kormik/manager
 /**
  * Returns whether the package matches the given expression.
  *
  * @param Expression $expr The search criteria. You can use the fields
  *                         {@link NAME}, {@link INSTALL_PATH} and
  *                         {@link STATE} in the expression.
  *
  * @return bool Returns `true` if the package matches the expression and
  *              `false` otherwise.
  */
 public function match(Expression $expr)
 {
     return $expr->evaluate(array(self::NAME => $this->name, self::INSTALL_PATH => $this->installPath, self::STATE => $this->state, self::INSTALLER => $this->installInfo ? $this->installInfo->getInstallerName() : null, self::ENVIRONMENT => $this->installInfo ? $this->installInfo->getEnvironment() : Environment::PROD));
 }