/** * device view test * @depends test_fetchArchive * @group ultimate **/ public function test_ultimate_deviceView() { $hd = new HandsetDetection\HD4($this->cloudConfig); $reply = $hd->deviceView('Nokia', 'N95'); $data = $hd->getReply(); $this->assertEquals($reply, true); $this->assertEquals(0, $data['status']); $this->assertEquals('OK', $data['message']); ksort($data['device']); ksort($this->devices['NokiaN95']); // print_r(json_encode($data['device'])); // print_r(json_encode($this->devices['NokiaN95'])); $this->assertEquals(strtolower(json_encode($this->devices['NokiaN95'])), strtolower(json_encode($data['device']))); }
} 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>"; // View information for a specific handset echo "<h1>Nokia N95 Properties</h1><p>"; if ($hd->deviceView('Nokia', 'N95')) { $data = $hd->getReply(); print_r($data); } else { print $hd->getError(); } echo "</p>"; // What handset have this attribute ? echo "<h1>Handsets with Network CDMA</h1><p>"; if ($hd->deviceWhatHas('network', 'CDMA')) { $data = $hd->getReply(); print_r($data); } else { print $hd->getError(); } echo "</p>";