mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-27 10:33:37 +00:00
Move helper class Test to separate include
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
class Test {
|
||||
const TEST_URL = 'https://127.0.0.1/php-curl-class/tests/server.php';
|
||||
|
||||
function __construct() {
|
||||
$this->curl = new Curl();
|
||||
$this->curl->setOpt(CURLOPT_SSL_VERIFYPEER, FALSE);
|
||||
$this->curl->setOpt(CURLOPT_SSL_VERIFYHOST, FALSE);
|
||||
}
|
||||
|
||||
function server($request_method, $data='') {
|
||||
$request_method = strtolower($request_method);
|
||||
$this->curl->$request_method(self::TEST_URL, $data);
|
||||
return $this->curl->response;
|
||||
}
|
||||
}
|
||||
+1
-16
@@ -2,24 +2,9 @@
|
||||
// Usage: phpunit --verbose run.php
|
||||
|
||||
require '../Curl.class.php';
|
||||
require 'helper.inc.php';
|
||||
|
||||
|
||||
class Test {
|
||||
const TEST_URL = 'https://127.0.0.1/php-curl-class/tests/server.php';
|
||||
|
||||
function __construct() {
|
||||
$this->curl = new Curl();
|
||||
$this->curl->setOpt(CURLOPT_SSL_VERIFYPEER, FALSE);
|
||||
$this->curl->setOpt(CURLOPT_SSL_VERIFYHOST, FALSE);
|
||||
}
|
||||
|
||||
function server($request_method, $data='') {
|
||||
$request_method = strtolower($request_method);
|
||||
$this->curl->$request_method(self::TEST_URL, $data);
|
||||
return $this->curl->response;
|
||||
}
|
||||
}
|
||||
|
||||
class CurlTest extends PHPUnit_Framework_TestCase {
|
||||
public function testExtensionLoaded() {
|
||||
$this->assertTrue(extension_loaded('curl'));
|
||||
|
||||
Reference in New Issue
Block a user