GraphQL\Tests\Language\LexerTest::testSkipsWhitespacesAndComments PHP Метод

testSkipsWhitespacesAndComments() публичный Метод

    public function testSkipsWhitespacesAndComments()
    {
        $example1 = '

    foo


';
        $expected = ['kind' => Token::NAME, 'start' => 6, 'end' => 9, 'value' => 'foo'];
        $this->assertArraySubset($expected, (array) $this->lexOne($example1));
        $example2 = '
    #comment
    foo#comment
';
        $expected = ['kind' => Token::NAME, 'start' => 18, 'end' => 21, 'value' => 'foo'];
        $this->assertArraySubset($expected, (array) $this->lexOne($example2));
        $expected = ['kind' => Token::NAME, 'start' => 3, 'end' => 6, 'value' => 'foo'];
        $example3 = ',,,foo,,,';
        $this->assertArraySubset($expected, (array) $this->lexOne($example3));
    }