From 3dec7a9995b79bb2c6bdfee369ff8740d811e63b Mon Sep 17 00:00:00 2001 From: vladar Date: Mon, 25 Apr 2016 19:50:03 +0600 Subject: [PATCH] Test complete validation --- tests/Validator/TestCase.php | 4 ++-- tests/Validator/ValidationTest.php | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 tests/Validator/ValidationTest.php diff --git a/tests/Validator/TestCase.php b/tests/Validator/TestCase.php index 0df6386..ed77714 100644 --- a/tests/Validator/TestCase.php +++ b/tests/Validator/TestCase.php @@ -343,11 +343,11 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase function expectPassesCompleteValidation($queryString) { - $this->expectValid($this->getDefaultSchema(), $this->getAllRules(), $queryString); + $this->expectValid($this->getDefaultSchema(), DocumentValidator::allRules(), $queryString); } function expectFailsCompleteValidation($queryString, $errors) { - $this->expectInvalid($this->getDefaultSchema(), $this->getAllRules(), $queryString, $errors); + $this->expectInvalid($this->getDefaultSchema(), DocumentValidator::allRules(), $queryString, $errors); } } diff --git a/tests/Validator/ValidationTest.php b/tests/Validator/ValidationTest.php new file mode 100644 index 0000000..8fb51ea --- /dev/null +++ b/tests/Validator/ValidationTest.php @@ -0,0 +1,30 @@ +expectPassesCompleteValidation(' + query { + catOrDog { + ... on Cat { + furColor + } + ... on Dog { + isHousetrained + } + } + } + '); + } +}