1 | <?php |
||
16 | class BrowserStackAPIClient implements IAPIClient |
||
17 | { |
||
18 | |||
19 | /** |
||
20 | * API username. |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | private $_apiUsername; |
||
25 | |||
26 | /** |
||
27 | * API key. |
||
28 | * |
||
29 | * @var string |
||
30 | */ |
||
31 | private $_apiKey; |
||
32 | |||
33 | /** |
||
34 | * Curl service. |
||
35 | * |
||
36 | * @var CurlServiceInterface |
||
37 | */ |
||
38 | private $_curlService; |
||
39 | |||
40 | /** |
||
41 | * Creates instance of API client. |
||
42 | * |
||
43 | * @param string $api_username API Username. |
||
44 | * @param string $api_key API Password. |
||
45 | * @param CurlServiceInterface $curl_service Curl service. |
||
46 | */ |
||
47 | 1 | public function __construct($api_username, $api_key, CurlServiceInterface $curl_service) |
|
53 | |||
54 | /** |
||
55 | * Returns information about session. |
||
56 | * |
||
57 | * @param string $session_id Session ID. |
||
58 | * |
||
59 | * @return array |
||
60 | */ |
||
61 | public function getInfo($session_id) |
||
67 | |||
68 | /** |
||
69 | * Update status of the test, that was executed in the given session. |
||
70 | * |
||
71 | * @param string $session_id Session ID. |
||
72 | * @param boolean $test_status Test status. |
||
73 | * |
||
74 | * @return array |
||
75 | */ |
||
76 | public function updateStatus($session_id, $test_status) |
||
83 | |||
84 | /** |
||
85 | * Execute BrowserStack REST API command. |
||
86 | * |
||
87 | * @param string $request_method HTTP request method. |
||
88 | * @param string $url URL. |
||
89 | * @param mixed $parameters Parameters. |
||
90 | * |
||
91 | * @return mixed |
||
92 | * @see http://www.browserstack.com/automate/rest-api |
||
93 | */ |
||
94 | protected function execute($request_method, $url, $parameters = null) |
||
107 | |||
108 | } |
||
109 |