GraphQL\Tests\ErrorTest::testConvertsNodeWithStart0ToPositionsAndLocations PHP Method

testConvertsNodeWithStart0ToPositionsAndLocations() public method

    public function testConvertsNodeWithStart0ToPositionsAndLocations()
    {
        $source = new Source('{
      field
    }');
        $ast = Parser::parse($source);
        $operationNode = $ast->definitions[0];
        $e = new Error('msg', [$operationNode]);
        $this->assertEquals([$operationNode], $e->nodes);
        $this->assertEquals($source, $e->getSource());
        $this->assertEquals([0], $e->getPositions());
        $this->assertEquals([new SourceLocation(1, 1)], $e->getLocations());
    }