]> git.mxchange.org Git - friendica.git/blob - tests/src/Network/CurlResultTest.php
79b950ca181a1e15d40d118122ee18bbd79a6cd5
[friendica.git] / tests / src / Network / CurlResultTest.php
1 <?php
2
3 namespace Friendica\Test\src\Network;
4
5 use Friendica\Network\CurlResult;
6 use PHPUnit\Framework\TestCase;
7
8 class CurlResultTest extends TestCase
9 {
10         public function setUp()
11         {
12                 parent::setUp(); // TODO: Change the autogenerated stub
13
14                 require_once __DIR__.'/../../../boot.php';
15                 require_once __DIR__.'/../../../include/text.php';
16         }
17
18         public function testNormal()
19         {
20                 $header = file_get_contents(__DIR__ . '/../../datasets/curl/about.head');
21                 $body = file_get_contents(__DIR__ . '/../../datasets/curl/about.body');
22
23
24                 $curlResult = new CurlResult('https://test.local', $header . $body, [ 'http_code' => 200 ]);
25
26                 $this->assertTrue($curlResult->isSuccess());
27                 $this->assertSame($header, $curlResult->getHeader());
28                 $this->assertSame($body, $curlResult->getBody());
29         }
30 }