3 namespace Friendica\Test\src\Network;
5 use Friendica\Network\CurlResult;
6 use PHPUnit\Framework\TestCase;
8 class CurlResultTest extends TestCase
10 public function setUp()
12 parent::setUp(); // TODO: Change the autogenerated stub
14 require_once __DIR__.'/../../../boot.php';
15 require_once __DIR__.'/../../../include/text.php';
18 public function testNormal()
20 $header = file_get_contents(__DIR__ . '/../../datasets/curl/about.head');
21 $body = file_get_contents(__DIR__ . '/../../datasets/curl/about.body');
24 $curlResult = new CurlResult('https://test.local', $header . $body, [ 'http_code' => 200 ]);
26 $this->assertTrue($curlResult->isSuccess());
27 $this->assertSame($header, $curlResult->getHeader());
28 $this->assertSame($body, $curlResult->getBody());