mirror of
https://github.com/friendica/friendica
synced 2025-04-26 02:30:11 +00:00
CurlResult Tests
This commit is contained in:
parent
71a60c5f66
commit
00bf0c24b6
4 changed files with 241 additions and 1 deletions
30
tests/src/Network/CurlResultTest.php
Normal file
30
tests/src/Network/CurlResultTest.php
Normal file
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
namespace Friendica\Test\src\Network;
|
||||
|
||||
use Friendica\Network\CurlResult;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class CurlResultTest extends TestCase
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp(); // TODO: Change the autogenerated stub
|
||||
|
||||
require_once __DIR__.'/../../../boot.php';
|
||||
require_once __DIR__.'/../../../include/text.php';
|
||||
}
|
||||
|
||||
public function testNormal()
|
||||
{
|
||||
$header = file_get_contents(__DIR__ . '/../../datasets/curl/about.head');
|
||||
$body = file_get_contents(__DIR__ . '/../../datasets/curl/about.body');
|
||||
|
||||
|
||||
$curlResult = new CurlResult('https://test.local', $header . $body, [ 'http_code' => 200 ]);
|
||||
|
||||
$this->assertTrue($curlResult->isSuccess());
|
||||
$this->assertSame($header, $curlResult->getHeader());
|
||||
$this->assertSame($body, $curlResult->getBody());
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue