public function AcquiaLiftTest::testGetPointsForAgent in Acquia Lift Connector 7
Test AcquiaLiftAPI->getPointsForAgent()
File
- tests/
AcquiaLiftAPI.test, line 782 - Unit tests for Acquia Lift module.
Class
- AcquiaLiftTest
- @file Unit tests for Acquia Lift module.
Code
public function testGetPointsForAgent() {
$lift_api = $this
->getAcquiaLiftAPI();
$agentName = 'some_machine_name';
$lift_api
->getPointsForAgent($agentName);
// Define the requests we expect to have been made to our dummy http
// client for this operation.
$requests = array(
array(
'type' => 'get',
'uri' => "{$lift_api->getApiUrl()}/{$lift_api->getOwnerCode()}/agent-api/{$agentName}/points?apikey={$lift_api->getAdminKey()}",
'headers' => array(
'Accept' => 'application/json',
),
'options' => array(),
'body' => NULL,
),
);
// Confirm the expected requests and logs.
$this
->assertAPIRequests($requests);
$logs = array();
$this
->assertLogs($logs);
$lift_api = $this
->getAcquiaLiftAPI(TRUE);
try {
$lift_api
->getPointsForAgent($agentName);
$this
->fail('Should not reach here');
} catch (AcquiaLiftException $e) {
}
// Confirm the expected requests and logs.
$this
->assertAPIRequests($requests);
$logs = array();
$this
->assertLogs($logs);
}