1
0
Fork 0
mirror of synced 2024-06-29 03:30:34 +12:00

feat: added unit test for setFilter

This commit is contained in:
Christy Jacob 2020-12-30 16:24:11 +05:30
parent c508657a50
commit a37a28fdc9
2 changed files with 36 additions and 2 deletions

View file

@ -16,8 +16,8 @@ class V06 extends Filter {
// Convert 0.7 Data format to 0.6 format
public function parse(array $content, string $model): array {
$parsedResponse = array();
$parsedResponse = [];
switch($model) {

View file

@ -0,0 +1,34 @@
<?php
namespace Appwrite\Tests;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Filter\V06;
use PHPUnit\Framework\TestCase;
use Swoole\Http\Response as SwooleResponse;
class ResponseTest extends TestCase
{
/**
* @var Response
*/
protected $object = null;
public function setUp(): void
{
$this->object = new Response(new SwooleResponse());
}
public function testSetFilter()
{
$this->assertEquals($this->object->isFilter(), false);
$this->assertEquals($this->object->getFilter(), null);
$filter = new V06();
$this->object->setFilter($filter);
$this->assertEquals($this->object->isFilter(), true);
$this->assertEquals($this->object->getFilter(), $filter);
}
}