/** * Recupera a ultima versão disponível * * @return string */ public static function getLatest() { if (null === self::$_latestVersion) { self::$_latestVersion = 'not available'; $handle = fopen('https://raw.githubusercontent.com/realejo/library-zf1/master/version', 'r'); if (false !== $handle) { self::$_latestVersion = stream_get_contents($handle); fclose($handle); } } return self::$_latestVersion; }
public function testCompareVersion() { $this->assertEquals(0, RW_Version::compareVersion(RW_Version::VERSION)); $this->assertContains(RW_Version::compareVersion(RW_Version::getLatest()), array(-1, 0, 1)); }