function testUpdateProjectGetWithOptions() { $statcounter = new LaravelStatcounter(self::CONFIG); $url = $statcounter->updateProject(PublicStats::ALL(), 'test')->toUrl(); $this->assertNotEmpty($url); $this->assertEquals($this->formatUrl('https://api.statcounter.com/update_project/', '?vn=3&pi=' . self::CONFIG['projects']['test'] . '&u=' . self::CONFIG['username'] . '&t=' . time() . '&ps=1', false), $url); }
/** * Start an 'update project' query. * * @param PublicStats $publicStats * @param string $websiteTitle * @return \Injic\LaravelStatcounter\LaravelStatcounter|static */ public function updateProject(PublicStats $publicStats, $websiteTitle = null) { $this->query = 'update_project'; $this->params['ps'] = $publicStats->getValue(); $this->params['pi'] = $this->projectFromConfig($websiteTitle); $this->usesUsername(); $this->usesTime(); return $this; }