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