zhamao-framework/tests/ZM/Utils/ZMRequestTest.php

35 lines
1.0 KiB
PHP
Raw Normal View History

2022-12-31 15:35:19 +08:00
<?php
declare(strict_types=1);
namespace Tests\ZM\Utils;
use PHPUnit\Framework\TestCase;
use Psr\Http\Message\ResponseInterface;
use ZM\Utils\ZMRequest;
/**
* @internal
*/
class ZMRequestTest extends TestCase
{
public function testPost()
{
2023-01-03 23:45:38 +08:00
$this->markTestIncomplete('Potential dead on Windows');
2024-10-02 20:31:16 +08:00
// $r = ZMRequest::post('http://httpbin.org/post', [], 'niubi=123');
// $this->assertStringContainsString('123', $r);
// $r2 = ZMRequest::post('http://httpbin.org/post', ['User-Agent' => 'test'], 'oijoij=ooo', [], false);
// $this->assertInstanceOf(ResponseInterface::class, $r2);
// $this->assertStringContainsString('ooo', $r2->getBody()->getContents());
2022-12-31 15:35:19 +08:00
}
public function testGet()
{
2023-01-03 23:45:38 +08:00
$this->markTestIncomplete('Potential dead on Windows');
2024-10-02 20:31:16 +08:00
// $r = ZMRequest::get('http://httpbin.org/get', [
// 'X-Test' => '123',
// ]);
// $this->assertStringContainsString('123', $r);
2022-12-31 15:35:19 +08:00
}
}