for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace TheCodingMachine\GraphQL\Controllers;
use GraphQL\Type\Definition\ObjectType;
use PHPUnit\Framework\TestCase;
class TypeRegistryTest extends TestCase
{
public function testRegisterTypeException()
$type = new ObjectType([
'name' => 'Foo',
'fields' => function() {return [];}
]);
$registry = new TypeRegistry();
$registry->registerType($type);
$this->expectException(GraphQLException::class);
}
public function testGetType()
$this->assertSame($type, $registry->getType('Foo'));
$registry->getType('Bar');
public function testHasType()
$this->assertTrue($registry->hasType('Foo'));
$this->assertFalse($registry->hasType('Bar'));