graphql-php/tests/Language/TokenTest.php

25 lines
490 B
PHP
Raw Normal View History

2017-10-04 18:06:25 +03:00
<?php
2018-09-01 21:21:08 +03:00
declare(strict_types=1);
2018-08-31 12:24:56 +03:00
namespace GraphQL\Tests\Language;
2017-10-04 18:06:25 +03:00
use GraphQL\Language\Token;
2018-07-29 18:43:10 +03:00
use PHPUnit\Framework\TestCase;
2017-10-04 18:06:25 +03:00
2018-07-29 18:43:10 +03:00
class TokenTest extends TestCase
2017-10-04 18:06:25 +03:00
{
public function testReturnTokenOnArray() : void
2017-10-04 18:06:25 +03:00
{
2018-09-01 21:21:08 +03:00
$token = new Token('Kind', 1, 10, 3, 5);
2017-10-04 18:06:25 +03:00
$expected = [
2018-09-01 21:21:08 +03:00
'kind' => 'Kind',
'value' => null,
'line' => 3,
'column' => 5,
2017-10-04 18:06:25 +03:00
];
2018-09-19 18:12:09 +03:00
self::assertEquals($expected, $token->toArray());
2017-10-04 18:06:25 +03:00
}
}