Ejemplo n.º 1
0
 public function testCompare()
 {
     $this->assertTrue(Version::compare('1.2.3', '1.2.3'));
     $this->assertTrue(Version::compare('1.2.3', '>1.2'));
     $this->assertTrue(Version::compare('1.2.2', '1 - 2'));
     $this->assertTrue(Version::compare('1.2.2', '~1.2'));
     $this->assertTrue(Version::compare('1.2.2', '^1.2'));
     $this->assertTrue(Version::compare('1.2.2', '1.2.*'));
     $this->assertTrue(Version::compare('1.2-beta', '<1.2'));
     $this->assertTrue(Version::compare('1.2-beta', '>1.2-alpha'));
     $this->assertTrue(Version::compare('1.2-rc', '>1.2-beta'));
     $this->assertTrue(Version::compare('1.3-rc', '~1.2'));
     $this->assertTrue(Version::compare('1.9', '^1.2'));
 }
Ejemplo n.º 2
0
 /**
  * {@inheritDoc}
  */
 public function checkVersion($version)
 {
     return Version::compare($version, $this->constraint);
 }