mirror of
https://github.com/retailcrm/graphql-php.git
synced 2024-11-22 21:06:05 +03:00
27 lines
730 B
PHP
27 lines
730 B
PHP
<?php
|
|
namespace GraphQL\Tests\Executor;
|
|
|
|
use GraphQL\Executor\ExecutionResult;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
class ExecutionResultTest extends TestCase
|
|
{
|
|
public function testToArrayWithoutExtensions() : void
|
|
{
|
|
$executionResult = new ExecutionResult();
|
|
|
|
$this->assertEquals([], $executionResult->toArray());
|
|
}
|
|
|
|
public function testToArrayExtensions() : void
|
|
{
|
|
$executionResult = new ExecutionResult(null, [], ['foo' => 'bar']);
|
|
|
|
$this->assertEquals(['extensions' => ['foo' => 'bar']], $executionResult->toArray());
|
|
|
|
$executionResult->extensions = ['bar' => 'foo'];
|
|
|
|
$this->assertEquals(['extensions' => ['bar' => 'foo']], $executionResult->toArray());
|
|
}
|
|
}
|