/**
  * 
  * @access public
  * @author "Lionel Lecaque, <*****@*****.**>"
  */
 public function testGetAvailableUpdates()
 {
     $this->service->setReleaseManifestUrl(BASE_URL . '/test/sample/releases10.xml');
     $availableUpdates = $this->service->getAvailableUpdates();
     $current = @file_get_contents(ROOT_PATH . 'version');
     $this->assertFalse(empty($availableUpdates));
     foreach ($availableUpdates as $update) {
         $this->assertNotEqual($update, $current);
     }
     //set Current version to 10.10.88
     @file_put_contents(ROOT_PATH . 'version', '10.10.88');
     $this->service->setReleaseManifestUrl(BASE_URL . '/test/sample/releases-patchsOnly.xml');
     $availableUpdates = $this->service->getAvailableUpdates();
     if (isset($availableUpdates['10.10.99']['version'])) {
         $this->assertEqual($availableUpdates['10.10.99']['version'], '10.10.99');
     } else {
         $this->fail('availableUpdates should only contain 10.10.99');
     }
     try {
         $this->service->setReleaseManifestUrl(BASE_URL . '/test/sample/badlink.xml');
         $availableUpdates = $this->service->getAvailableUpdates();
     } catch (Exception $e) {
         $this->assertIsA($e, 'taoUpdate_models_classes_UpdateException');
     }
     $this->service->setReleaseManifestUrl(BASE_URL . '/test/sample/releases-noNewPatch.xml');
     $availableUpdates = $this->service->getAvailableUpdates();
     $this->assertTrue(empty($availableUpdates));
     //set Current version back to current
     @file_put_contents(ROOT_PATH . 'version', $current);
 }
 protected function __construct()
 {
     $this->releasesService = taoUpdate_models_classes_ReleasesService::singleton();
     $this->initReleaseService(RELEASES_MANIFEST);
     $this->backupService = taoUpdate_models_classes_BackupService::singleton();
     $this->shieldService = taoUpdate_models_classes_ShieldService::singleton();
     $this->generateKey();
 }