1
0
Fork 0
mirror of synced 2024-07-06 23:21:05 +12:00
appwrite/tests/unit/GraphQL/BuilderTest.php
2022-10-14 18:01:39 +13:00

30 lines
709 B
PHP

<?php
namespace Tests\Unit\GraphQL;
use Appwrite\GraphQL\Types\Mapper;
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());
Mapper::init($this->response->getModels());
}
/**
* @throws \Exception
*/
public function testCreateTypeMapping()
{
$model = $this->response->getModel(Response::MODEL_COLLECTION);
$type = Mapper::model(\ucfirst($model->getType()));
$this->assertEquals('Collection', $type->name);
}
}