From e8b1329963ca9b720757802d3a16ade02cb0c44a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Pel=C3=AD=C5=A1ek?= Date: Sat, 9 Jan 2021 19:59:28 +0100 Subject: [PATCH] added new error messages to tests --- tests/Unit/Type/InterfaceTypeTest.php | 66 +++++++++++++-------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/tests/Unit/Type/InterfaceTypeTest.php b/tests/Unit/Type/InterfaceTypeTest.php index aac9f684c..6d0b26c77 100644 --- a/tests/Unit/Type/InterfaceTypeTest.php +++ b/tests/Unit/Type/InterfaceTypeTest.php @@ -37,21 +37,21 @@ protected function getFieldDefinition() : \Graphpinator\Field\FieldSet \Graphpinator\Container\Container::Int()->notNull(), ), new \Graphpinator\Field\Field( - 'argument', + 'fieldArg', \Graphpinator\Container\Container::Int()->notNull(), new \Graphpinator\Argument\ArgumentSet([ new \Graphpinator\Argument\Argument( - 'argumentName', + 'argName', \Graphpinator\Container\Container::Int(), ), ]), ), new \Graphpinator\Field\Field( - 'argumentNotNull', + 'fieldArgNotNull', \Graphpinator\Container\Container::Int()->notNull(), new \Graphpinator\Argument\ArgumentSet([ new \Graphpinator\Argument\Argument( - 'argumentName', + 'argName', \Graphpinator\Container\Container::Int()->notNull(), ), ]), @@ -144,25 +144,25 @@ static function () : void { }, ), new \Graphpinator\Field\ResolvableField( - 'argument', + 'fieldArg', \Graphpinator\Container\Container::Int()->notNull(), static function () : void { }, new \Graphpinator\Argument\ArgumentSet([ new \Graphpinator\Argument\Argument( - 'argumentName', + 'argName', \Graphpinator\Container\Container::Int(), ), ]), ), new \Graphpinator\Field\ResolvableField( - 'argumentNotNull', + 'fieldArgNotNull', \Graphpinator\Container\Container::Int()->notNull(), static function () : void { }, new \Graphpinator\Argument\ArgumentSet([ new \Graphpinator\Argument\Argument( - 'argumentName', + 'argName', \Graphpinator\Container\Container::Int()->notNull(), ), ]), @@ -207,25 +207,25 @@ static function () : void { }, ), new \Graphpinator\Field\ResolvableField( - 'argument', + 'fieldArg', \Graphpinator\Container\Container::Int()->notNull(), static function () : void { }, new \Graphpinator\Argument\ArgumentSet([ new \Graphpinator\Argument\Argument( - 'argumentName', + 'argName', \Graphpinator\Container\Container::Int(), ), ]), ), new \Graphpinator\Field\ResolvableField( - 'argumentNotNull', + 'fieldArgNotNull', \Graphpinator\Container\Container::Int()->notNull(), static function () : void { }, new \Graphpinator\Argument\ArgumentSet([ new \Graphpinator\Argument\Argument( - 'argumentName', + 'argName', \Graphpinator\Container\Container::Int()->notNull(), ), ]), @@ -270,19 +270,19 @@ static function () : void { }, ), new \Graphpinator\Field\ResolvableField( - 'argument', + 'fieldArg', \Graphpinator\Container\Container::Int()->notNull(), static function () : void { }, ), new \Graphpinator\Field\ResolvableField( - 'argumentNotNull', + 'fieldArgNotNull', \Graphpinator\Container\Container::Int()->notNull(), static function () : void { }, new \Graphpinator\Argument\ArgumentSet([ new \Graphpinator\Argument\Argument( - 'argumentName', + 'argName', \Graphpinator\Container\Container::Int()->notNull(), ), ]), @@ -327,25 +327,25 @@ static function () : void { }, ), new \Graphpinator\Field\ResolvableField( - 'argument', + 'fieldArg', \Graphpinator\Container\Container::Int()->notNull(), static function () : void { }, new \Graphpinator\Argument\ArgumentSet([ new \Graphpinator\Argument\Argument( - 'argumentName', + 'argName', \Graphpinator\Container\Container::Int(), ), ]), ), new \Graphpinator\Field\ResolvableField( - 'argumentNotNull', + 'fieldArgNotNull', \Graphpinator\Container\Container::Int()->notNull(), static function () : void { }, new \Graphpinator\Argument\ArgumentSet([ new \Graphpinator\Argument\Argument( - 'argumentName', + 'argName', \Graphpinator\Container\Container::Boolean()->notNull(), ), ]), @@ -390,25 +390,25 @@ static function () : void { }, ), new \Graphpinator\Field\ResolvableField( - 'argument', + 'fieldArg', \Graphpinator\Container\Container::Int()->notNull(), static function () : void { }, new \Graphpinator\Argument\ArgumentSet([ new \Graphpinator\Argument\Argument( - 'argumentName', + 'argName', \Graphpinator\Container\Container::Int()->notNull(), ), ]), ), new \Graphpinator\Field\ResolvableField( - 'argumentNotNull', + 'fieldArgNotNull', \Graphpinator\Container\Container::Int()->notNull(), static function () : void { }, new \Graphpinator\Argument\ArgumentSet([ new \Graphpinator\Argument\Argument( - 'argumentName', + 'argName', \Graphpinator\Container\Container::Int()->notNull(), ), ]), @@ -470,25 +470,25 @@ static function () : void { }, ), new \Graphpinator\Field\ResolvableField( - 'argument', + 'fieldArg', \Graphpinator\Container\Container::Int()->notNull(), static function () : void { }, new \Graphpinator\Argument\ArgumentSet([ new \Graphpinator\Argument\Argument( - 'argumentName', + 'argName', \Graphpinator\Container\Container::Int(), ), ]), ), new \Graphpinator\Field\ResolvableField( - 'argumentNotNull', + 'fieldArgNotNull', \Graphpinator\Container\Container::Int()->notNull(), static function () : void { }, new \Graphpinator\Argument\ArgumentSet([ new \Graphpinator\Argument\Argument( - 'argumentName', + 'argName', \Graphpinator\Container\Container::Int()->notNull(), ), ]), @@ -562,7 +562,7 @@ public function testSimple() : void public function testMissingField() : void { $this->expectException(\Graphpinator\Exception\Type\InterfaceContractMissingField::class); - $this->expectExceptionMessage(\Graphpinator\Exception\Type\InterfaceContractMissingField::MESSAGE); + $this->expectExceptionMessage('Type "Abc" does not satisfy interface "Foo" - missing field "field".'); self::getTypeMissingField()->getFields(); } @@ -570,7 +570,7 @@ public function testMissingField() : void public function testIncompatibleFieldType() : void { $this->expectException(\Graphpinator\Exception\Type\InterfaceContractFieldTypeMismatch::class); - $this->expectExceptionMessage(\Graphpinator\Exception\Type\InterfaceContractFieldTypeMismatch::MESSAGE); + $this->expectExceptionMessage('Type "Abc" does not satisfy interface "Foo" - field "fieldNotNull" does not have a compatible type.'); self::getTypeFieldTypeMismatch()->getFields(); } @@ -578,7 +578,7 @@ public function testIncompatibleFieldType() : void public function testIncompatibleFieldTypeContravariance() : void { $this->expectException(\Graphpinator\Exception\Type\InterfaceContractFieldTypeMismatch::class); - $this->expectExceptionMessage(\Graphpinator\Exception\Type\InterfaceContractFieldTypeMismatch::MESSAGE); + $this->expectExceptionMessage('Type "Abc" does not satisfy interface "Foo" - field "fieldNotNull" does not have a compatible type.'); self::getTypeFieldTypeMismatchCovariance()->getFields(); } @@ -586,7 +586,7 @@ public function testIncompatibleFieldTypeContravariance() : void public function testMissingArgument() : void { $this->expectException(\Graphpinator\Exception\Type\InterfaceContractMissingArgument::class); - $this->expectExceptionMessage(\Graphpinator\Exception\Type\InterfaceContractMissingArgument::MESSAGE); + $this->expectExceptionMessage('Type "Abc" does not satisfy interface "Foo" - argument "argName" on field "fieldArg" is missing.'); self::getTypeMissingArgument()->getFields(); } @@ -594,7 +594,7 @@ public function testMissingArgument() : void public function testIncompatibleArgumentType() : void { $this->expectException(\Graphpinator\Exception\Type\InterfaceContractArgumentTypeMismatch::class); - $this->expectExceptionMessage(\Graphpinator\Exception\Type\InterfaceContractArgumentTypeMismatch::MESSAGE); + $this->expectExceptionMessage('Type "Abc" does not satisfy interface "Foo" - argument "argName" on field "fieldArgNotNull" does not have a compatible type.'); self::getTypeArgumentTypeMismatch()->getFields(); } @@ -602,7 +602,7 @@ public function testIncompatibleArgumentType() : void public function testIncompatibleArgumentTypeContravariance() : void { $this->expectException(\Graphpinator\Exception\Type\InterfaceContractArgumentTypeMismatch::class); - $this->expectExceptionMessage(\Graphpinator\Exception\Type\InterfaceContractArgumentTypeMismatch::MESSAGE); + $this->expectExceptionMessage('Type "Abc" does not satisfy interface "Foo" - argument "argName" on field "fieldArg" does not have a compatible type.'); self::getTypeArgumentTypeMismatchContravariance()->getFields(); }