Exemplo n.º 1
0
 static function setUpBeforeClass()
 {
     $hd4 = new HandsetDetection\HD4('hd4UltimateConfig.php');
     echo "Fetching Archive-";
     $hd4->communityFetchArchive();
     echo "Done";
     return true;
 }
Exemplo n.º 2
0
 /**
  * Fetch Archive Test
  *
  * The community fetchArchive version contains a cut down version of the device specs.
  * It has general_vendor, general_model, display_x, display_y, general_platform, general_platform_version,
  * general_browser, general_browser_version, general_app, general_app_version, general_language,
  * general_language_full, benahmark_min & benchmark_max
  *
  * @group community
  **/
 function test_ultimate_community_fetchArchive()
 {
     // Start tests with a clean slate
     $store = HandsetDetection\HDStore::getInstance();
     $store->purge();
     // Note : request storage dir to be created if it does not exist. (with TRUE as 2nd param)
     $hd = new HandsetDetection\HD4($this->ultimateConfig, true);
     $result = $hd->communityFetchArchive();
     $this->assertTrue($result);
     $data = $hd->getRawReply();
     echo "Downloaded " . strlen($data) . " bytes";
     $this->assertGreaterThan(9000000, strlen($data));
     // Filesize greater than 9Mb
 }
Exemplo n.º 3
0
 /**
  * Fetch Archive Test
  *
  * The community fetchArchive version contains a cut down version of the device specs.
  * It has general_vendor, general_model, display_x, display_y, general_platform, general_platform_version,
  * general_browser, general_browser_version, general_app, general_app_version, general_language,
  * general_language_full, benahmark_min & benchmark_max
  *
  * @group community
  **/
 function test_ultimate_community_fetchArchive()
 {
     $hd = new HandsetDetection\HD4($this->ultimateConfig);
     $hd->setTimeout(500);
     // Purge store
     $hd->Store->purge();
     // Fetch new device specs into store.
     $result = $hd->communityFetchArchive();
     $data = $hd->getRawReply();
     $size = strlen($data);
     echo "Downloaded {$size} bytes ";
     if ($size < 1000) {
         $this->markTestSkipped($data);
     } else {
         $this->assertTrue($result);
         $this->assertGreaterThan(9000000, strlen($data));
         // Filesize greater than 9Mb
     }
 }