suyuan/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/BodyResultTest.php

27 lines
655 B
PHP
Raw Normal View History

2023-10-14 13:36:39 +08:00
<?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(), "");
}
}