Update printSchema for recent SDL change to implements

This commit is contained in:
Vladimir Razuvaev 2018-08-08 15:07:08 +07:00
parent fcb9c24bb5
commit 56e91d008e
2 changed files with 5 additions and 3 deletions

View File

@ -159,7 +159,7 @@ class SchemaPrinter
{ {
$interfaces = $type->getInterfaces(); $interfaces = $type->getInterfaces();
$implementedInterfaces = !empty($interfaces) ? $implementedInterfaces = !empty($interfaces) ?
' implements ' . implode(', ', array_map(function($i) { ' implements ' . implode(' & ', array_map(function($i) {
return $i->name; return $i->name;
}, $interfaces)) : ''; }, $interfaces)) : '';
return self::printDescription($options, $type) . return self::printDescription($options, $type) .

View File

@ -21,7 +21,9 @@ class SchemaPrinterTest extends TestCase
private function printForTest($schema) private function printForTest($schema)
{ {
return "\n" . SchemaPrinter::doPrint($schema); $schemaText = SchemaPrinter::doPrint($schema);
$this->assertEquals($schemaText, SchemaPrinter::doPrint(BuildSchema::build($schemaText)));
return "\n" . $schemaText;
} }
private function printSingleFieldSchema($fieldConfig) private function printSingleFieldSchema($fieldConfig)
@ -464,7 +466,7 @@ interface Baaz {
int: Int int: Int
} }
type Bar implements Foo, Baaz { type Bar implements Foo & Baaz {
str: String str: String
int: Int int: Int
} }