Exemplo n.º 1
0
 /**
  * device vendors test
  * @depends test_fetchArchive
  * @group ultimate
  **/
 function test_ultimate_deviceVendors()
 {
     $hd = new HandsetDetection\HD4($this->cloudConfig);
     $result = $hd->deviceVendors();
     $reply = $hd->getReply();
     //print_r($reply);
     $this->assertTrue($result);
     $this->assertEquals(0, $reply['status']);
     $this->assertEquals('OK', $reply['message']);
     $this->assertContains('Nokia', $reply['vendor']);
     $this->assertContains('Samsung', $reply['vendor']);
 }
Exemplo n.º 2
0
error_reporting(E_ALL);
$configFile = 'hdconfig.php';
//$configFile = 'hd4UltimateConfig.php';
// Ensure config file is setup.
if (!file_exists($configFile)) {
    die('Config file not found');
}
include $configFile;
if (@$hdconfig['username'] == "your_api_username") {
    die('Please configure your username, secret and site_id');
}
require_once 'HD4.php';
$hd = new HandsetDetection\HD4($configFile);
/// Vendors example : Get a list of all vendors
echo "<h1>Vendors</h1><p>";
if ($hd->deviceVendors()) {
    $data = $hd->getReply();
    print_r($data);
} else {
    print $hd->getError();
}
echo "</p>";
// Models example : Get a list of all models for a specific vendor
echo "<h1>Nokia Models</h1><p>";
if ($hd->deviceModels('Nokia')) {
    $data = $hd->getReply();
    print_r($data);
} else {
    print $hd->getError();
}
echo "</p>";