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