public function testGetEndpoint() { $request = new Request(Type::TYPE_DOMAIN_RANKS, ['key' => $this->key, 'domain' => $this->domain]); $this->assertEquals("http://api.semrush.com/", $request->getEndpoint()); $request = new Request(Type::TYPE_ADVERTISER_RANK, ['key' => $this->key, 'domain' => $this->domain]); $this->assertEquals("http://api.semrush.com/analytics/da/v2/", $request->getEndpoint()); }
/** * Get the URL of this request * * @return string */ protected function getUrl() { $params = $this->getOptionsAsStrings(); return $this->request->getEndpoint() . "?" . http_build_query($params); }