You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
655 B
26 lines
655 B
<?php
|
|
|
|
namespace OSS\Tests;
|
|
|
|
use OSS\Http\ResponseCore;
|
|
use OSS\Result\BodyResult;
|
|
|
|
|
|
class BodyResultTest extends \PHPUnit\Framework\TestCase
|
|
{
|
|
public function testParseValid200()
|
|
{
|
|
$response = new ResponseCore(array(), "hi", 200);
|
|
$result = new BodyResult($response);
|
|
$this->assertTrue($result->isOK());
|
|
$this->assertEquals($result->getData(), "hi");
|
|
}
|
|
|
|
public function testParseInvalid404()
|
|
{
|
|
$response = new ResponseCore(array(), null, 200);
|
|
$result = new BodyResult($response);
|
|
$this->assertTrue($result->isOK());
|
|
$this->assertEquals($result->getData(), "");
|
|
}
|
|
}
|
|
|