2021-03-17 09:05:48 +13:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Appwrite\Tests;
|
|
|
|
|
|
|
|
use Appwrite\Event\Event;
|
2022-07-13 21:34:56 +12:00
|
|
|
use Appwrite\GraphQL\SchemaBuilder;
|
|
|
|
use Appwrite\GraphQL\TypeRegistry;
|
2021-03-17 09:05:48 +13:00
|
|
|
use Appwrite\Utopia\Response;
|
|
|
|
use Appwrite\Utopia\Response\Model;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
use Swoole\Http\Response as SwooleResponse;
|
|
|
|
use Utopia\App;
|
|
|
|
|
|
|
|
class BuilderTest extends TestCase
|
|
|
|
{
|
2022-07-13 21:34:56 +12:00
|
|
|
protected ?Response $response = null;
|
2021-03-17 09:05:48 +13:00
|
|
|
|
|
|
|
public function setUp(): void
|
|
|
|
{
|
|
|
|
$this->response = new Response(new SwooleResponse());
|
2022-07-13 21:34:56 +12:00
|
|
|
TypeRegistry::init($this->response->getModels());
|
2021-03-17 09:05:48 +13:00
|
|
|
}
|
|
|
|
|
2022-07-13 21:34:56 +12:00
|
|
|
/**
|
|
|
|
* @throws \Exception
|
|
|
|
*/
|
2022-07-12 09:52:00 +12:00
|
|
|
public function testCreateTypeMapping()
|
2021-03-17 09:05:48 +13:00
|
|
|
{
|
|
|
|
$model = $this->response->getModel(Response::MODEL_COLLECTION);
|
2022-07-13 21:34:56 +12:00
|
|
|
$typeMapping = TypeRegistry::get($model->getType());
|
2021-03-17 09:05:48 +13:00
|
|
|
}
|
2022-07-12 09:52:00 +12:00
|
|
|
}
|