public static function getVersions()
 {
     $response = array();
     if (UrlUtils::checkRemoteFile('http://www.technicpack.net/api/minecraft', 15)['success']) {
         $response = UrlUtils::get_url_contents('http://www.technicpack.net/api/minecraft', 15);
         if ($response['success']) {
             $response = json_decode($response['data'], true);
             krsort($response);
             Cache::put('minecraftversions', $response, 180);
             return $response;
         }
     }
     if (UrlUtils::checkRemoteFile('https://s3.amazonaws.com/Minecraft.Download/versions/versions.json', 15)['success']) {
         $response = UrlUtils::get_url_contents('https://s3.amazonaws.com/Minecraft.Download/versions/versions.json', 15);
         if ($response['success']) {
             $mojangResponse = json_decode($response['data'], true);
             $versions = array();
             foreach ($mojangResponse['versions'] as $versionEntry) {
                 if ($versionEntry['type'] != 'release') {
                     continue;
                 }
                 $mcVersion = $versionEntry['id'];
                 $versions[$mcVersion] = array('version' => $mcVersion);
             }
             krsort($versions);
             Cache::put('minecraftversions', $versions, 180);
             return $versions;
         }
     }
     return $response;
 }
 public function testCheckRemoteFileNon200()
 {
     $json = UrlUtils::checkRemoteFile("http://speedtest.wdc01.softlayer.com/downloads/testbob.zip", 5);
     $this->assertTrue(is_array($json));
     $this->assertTrue(array_key_exists('success', $json));
     $this->assertFalse($json['success']);
     $this->assertTrue(array_key_exists('message', $json));
     $this->assertTrue(array_key_exists('info', $json));
     $this->assertEquals('404', $json['info']['http_code']);
 }