- protected function request($file, $method = 'GET', $payload = '')
- {
- $url = $this->baseUrl . $file;
-
- $ch = curl_init($url);
- curl_setopt_array($ch, array(
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_FAILONERROR => true
- ));
- if ($method == 'POST')
- {
- curl_setopt_array($ch, array(
- CURLOPT_POST => true,
- CURLOPT_POSTFIELDS => $payload
- ));
- }
- if ($this->collectCodeCoverageInformation)
- {
- curl_setopt($ch, CURLOPT_COOKIE, 'PHPUNIT_SELENIUM_TEST_ID=true');
- }
- if ($this->args['DEBUG'] > 0) {
- curl_setopt($ch, CURLOPT_VERBOSE, 1);
- }
- $page = curl_exec($ch);
- curl_close($ch);
-
- $this->assertNotFalse($page);
- $this->assertNotContains('Fatal error', $page);
- $this->assertNotContains('Notice:', $page);
-
- return $page;
- }
-