public function testCreate() { $installInfo = new InstallInfo('vendor/package', '/path'); $installInfo->setInstallerName('Composer'); $this->assertSame('vendor/package', $installInfo->getPackageName()); $this->assertSame('/path', $installInfo->getInstallPath()); $this->assertSame('Composer', $installInfo->getInstallerName()); }
/** * 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)); }
/** * 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)); }