Deleted useless code.

This commit is contained in:
李铭昕 2019-07-11 16:25:46 +08:00
parent 56d5978c42
commit 9fca0bfb00

View File

@ -27,11 +27,6 @@ use Swoole\Coroutine;
*/
class CoroutineHandlerTest extends TestCase
{
public function testExample()
{
$this->assertTrue(true);
}
public function testCreatesCurlErrors()
{
if (Coroutine::getuid() > 0) {
@ -115,21 +110,17 @@ class CoroutineHandlerTest extends TestCase
public function testUserInfo()
{
if (Coroutine::getuid() > 0) {
$url = 'https://username:password@api.tb.swoft.lmx0536.cn';
$handler = new CoroutineHandler();
$request = new Request('GET', $url . '/echo');
$url = 'https://username:password@api.tb.swoft.lmx0536.cn';
$handler = new CoroutineHandler();
$request = new Request('GET', $url . '/echo');
$res = $handler($request, ['timeout' => 5])->wait();
$content = $res->getBody()->getContents();
$json = json_decode($content, true);
$res = $handler($request, ['timeout' => 5])->wait();
$content = $res->getBody()->getContents();
$json = json_decode($content, true);
$this->assertEquals(0, $json['code']);
$json = $json['data'];
$this->assertEquals('Basic ' . base64_encode('username:password'), $json['headers']['authorization'][0]);
}
$this->assertTrue(true);
$this->assertEquals(0, $json['code']);
$json = $json['data'];
$this->assertEquals('Basic ' . base64_encode('username:password'), $json['headers']['authorization'][0]);
}
protected function getHandler($options = [])