Exemplo n.º 1
0
 public function testHttpRedirectServiceCreation()
 {
     $httpRedirect = new HTTPRedirect();
     $httpRedirect->setUrl('http://example.com/other')->setCode(302)->setKeepUri(false);
     // simulate the Dyn API response
     $this->apiClient->getHttpClient()->getAdapter()->setResponse("HTTP/1.1 200 OK" . "\r\n" . "Content-type: application/json" . "\r\n\r\n" . '{"status": "success", "data": {"url": "http://example.com/other", "code": "302", "keep_uri": "False", "fqdn": "test.example.com", "zone": "example.com"}, "job_id": 12345678, "msgs": [{"INFO": "add_node: New node added to zone", "SOURCE": "BLL", "ERR_CD": null, "LVL": "INFO"}, {"INFO": "add: Service added", "SOURCE": "BLL", "ERR_CD": null, "LVL": "INFO"}]}');
     $this->assertInstanceOf('Dyn\\TrafficManagement\\Service\\HTTPRedirect', $this->zone->createService($httpRedirect, 'test.example.com'));
 }