/** * @test */ public function it_returns_the_host_name_with_passed_in_uri() { $expected = "http://someknown.host"; $client = new Client($this->buildConfig(['connectwise' => ['host' => $expected]])); $this->assertEquals($expected, $client->getHost('/')); $expected .= '/some.uri'; $this->assertEquals($expected, $client->getHost('some.uri')); $this->assertEquals($expected, $client->getHost('/some.uri')); }
/** * Builds the url from the known variables of the client & and the passed in id. * * @param string $format * @param int $id * * @return string */ private function buildUrl($format, $id) { $this->validator->validateIntegerProperty('Id', $id); $company = urlencode($this->client->get('config')['connectwise']['company']); return sprintf($format, $this->client->getHost(), $id, $company); }