1 | <?php |
||
17 | class WebServerListenerTrait |
||
18 | { |
||
19 | /** |
||
20 | * PHP web server PID. |
||
21 | * |
||
22 | * @var int |
||
23 | */ |
||
24 | protected $pid; |
||
25 | |||
26 | /** |
||
27 | * Make sure the PHP built-in web server is running for tests with group |
||
28 | * 'webserver'. |
||
29 | */ |
||
30 | public function startTestSuite($suite) |
||
48 | |||
49 | /** |
||
50 | * Get web server hostname. |
||
51 | * |
||
52 | * @throws \Exception |
||
53 | * |
||
54 | * @return string |
||
55 | */ |
||
56 | public function getHostName() |
||
64 | |||
65 | /** |
||
66 | * Get web server port. |
||
67 | * |
||
68 | * @throws \Exception |
||
69 | * |
||
70 | * @return int |
||
71 | */ |
||
72 | public function getPort() |
||
80 | |||
81 | /** |
||
82 | * Get web server port. |
||
83 | * |
||
84 | * @throws \Exception |
||
85 | * |
||
86 | * @return int |
||
87 | */ |
||
88 | public function getDocRoot() |
||
96 | |||
97 | /** |
||
98 | * Start PHP built-in web server. |
||
99 | * |
||
100 | * @return int PID |
||
101 | */ |
||
102 | public function startPhpWebServer() |
||
116 | |||
117 | /** |
||
118 | * Wait for caching proxy to be started up and reachable. |
||
119 | * |
||
120 | * @param string $ip |
||
121 | * @param int $port |
||
122 | * @param int $timeout Timeout in milliseconds |
||
123 | * |
||
124 | * @throws \RuntimeException If proxy is not reachable within timeout |
||
125 | */ |
||
126 | public function waitFor($ip, $port, $timeout) |
||
144 | } |
||
145 |