1
0
Fork 0
mirror of synced 2024-07-04 22:20:45 +12:00

Fix unit test

This commit is contained in:
Jake Barnby 2022-10-11 14:20:19 +13:00
parent bf194c30e9
commit 20bee94175
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C

View file

@ -1,15 +1,11 @@
<?php
namespace Appwrite\Tests;
namespace Tests\Unit\GraphQL;
use Appwrite\Event\Event;
use Appwrite\GraphQL\SchemaBuilder;
use Appwrite\GraphQL\TypeRegistry;
use Appwrite\GraphQL\TypeMapper;
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
{
@ -18,7 +14,7 @@ class BuilderTest extends TestCase
public function setUp(): void
{
$this->response = new Response(new SwooleResponse());
TypeRegistry::init($this->response->getModels());
TypeMapper::init($this->response->getModels());
}
/**
@ -27,6 +23,7 @@ class BuilderTest extends TestCase
public function testCreateTypeMapping()
{
$model = $this->response->getModel(Response::MODEL_COLLECTION);
$typeMapping = TypeRegistry::fromModel($model->getType());
$type = TypeMapper::fromResponseModel(\ucfirst($model->getType()));
$this->assertEquals('Collection', $type->name);
}
}