function testDownloadLinkGetWithOptions() { $statcounter = new LaravelStatcounter(self::CONFIG); $url = $statcounter->downloadLink(Device::DESKTOP())->toUrl(); $this->assertNotEmpty($url); $this->assertEquals($this->formatUrl('https://api.statcounter.com/stats/', '?vn=3&s=download-link-activity&pi=%3$s&u=%1$s&t=%2$s&de=desktop'), $url); }
/** * Start an 'download link activity' query. * * @param Device $device * @return \Injic\LaravelStatcounter\LaravelStatcounter|static */ public function downloadLink(Device $device = null) { if (is_null($device)) { $device = Device::ALL(); } $this->initStats('download-link-activity'); $this->params['de'] = $device->getValue(); return $this; }