1
0
Fork 0
mirror of synced 2024-07-27 01:06:15 +12:00
appwrite/tests/unit/GraphQL/BuilderTest.php
2022-10-11 14:20:19 +13:00

30 lines
727 B
PHP

<?php
namespace Tests\Unit\GraphQL;
use Appwrite\GraphQL\TypeMapper;
use Appwrite\Utopia\Response;
use PHPUnit\Framework\TestCase;
use Swoole\Http\Response as SwooleResponse;
class BuilderTest extends TestCase
{
protected ?Response $response = null;
public function setUp(): void
{
$this->response = new Response(new SwooleResponse());
TypeMapper::init($this->response->getModels());
}
/**
* @throws \Exception
*/
public function testCreateTypeMapping()
{
$model = $this->response->getModel(Response::MODEL_COLLECTION);
$type = TypeMapper::fromResponseModel(\ucfirst($model->getType()));
$this->assertEquals('Collection', $type->name);
}
}