public function testSetEnvironment() { $installInfo = new InstallInfo('vendor/package', '/path'); $installInfo->setEnvironment(Environment::PROD); $this->assertSame(Environment::PROD, $installInfo->getEnvironment()); }
/** * 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)); }