diff --git a/src/Connector/Client.php b/src/Connector/Client.php index 089f27bd..e9aa66f3 100644 --- a/src/Connector/Client.php +++ b/src/Connector/Client.php @@ -29,6 +29,11 @@ class Client implements ClientInterface */ protected $options = []; + /** + * @var array User agent strings to be concatenated and added to each request. + */ + protected $userAgent = []; + /** * Client constructor. * @@ -203,4 +208,20 @@ public function addOption($name, $value): void { $this->options = array_merge_recursive($this->options, [$name => $value]); } + + /** + * @inheritdoc + */ + public function setUserAgent($name): void + { + $this->userAgent[$name] = $name; + } + + /** + * @inheritdoc + */ + public function getUserAgent(): array + { + return $this->userAgent; + } } diff --git a/tests/Endpoints/ClientTest.php b/tests/Endpoints/ClientTest.php index 24b05614..8a32ef42 100644 --- a/tests/Endpoints/ClientTest.php +++ b/tests/Endpoints/ClientTest.php @@ -86,7 +86,6 @@ public function testModifyOptions() $client->addOption('headers', ['User-Agent' => 'AcquiaCli/4.20']); $client->addOption('headers', ['User-Agent' => 'ZCli/1.1.1']); $client->addOption('headers', ['User-Agent' => 'AaahCli/0.1']); - $client->addQuery('filter', 'name=@*2014*'); $client->addQuery('filter', 'type=@*true*'); $client->addQuery('limit', '1');