public function testCompoundExpression() { $expression = new CompoundExpression(CompoundExpression::DISJUNCTIVE, [new Primitive('1.0.0', Primitive::OPERATOR_EQ), '>2.3.4']); $this->assertTrue($expression->matches(Version::fromString('1.0.0'))); $this->assertTrue($expression->matches(Version::fromString('3.0.0'))); $this->assertTrue($expression->matches(Version::fromString('2.3.5'))); $this->assertFalse($expression->matches(Version::fromString('1.0.0-alpha'))); $this->assertFalse($expression->matches(Version::fromString('2.3.4'))); $this->assertFalse($expression->matches(Version::fromString('0.9.9'))); }
/** * @param VersionInterface $version * @return bool Whether the version is matches by this expression. */ public function matches(VersionInterface $version) { return $this->rootExpression->matches($version); }