setExpectedException( Error::class, '"__bad" must not begin with "__", which is reserved by GraphQL introspection.' ); Utils::assertValidName('__bad'); } /** * @it throws for non-strings */ public function testThrowsForNonStrings() { $this->setExpectedException( InvariantViolation::class, 'Expected string' ); Utils::assertValidName([]); } /** * @it throws for names with invalid characters */ public function testThrowsForNamesWithInvalidCharacters() { $this->setExpectedException( Error::class, 'Names must match' ); Utils::assertValidName('>--()-->'); } }