We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| 1 | <?php |
||
| 19 | class ExecutorTest extends \PHPUnit_Framework_TestCase |
||
| 20 | { |
||
| 21 | /** @var Executor */ |
||
| 22 | private $executor; |
||
| 23 | |||
| 24 | private $request = ['query' => 'query debug{ myField }', 'variables' => [], 'operationName' => null]; |
||
| 25 | |||
| 26 | public function setUp() |
||
| 27 | { |
||
| 28 | $this->executor = new Executor(); |
||
| 29 | } |
||
| 30 | |||
| 31 | public function testDisabledDebugInfo() |
||
| 32 | { |
||
| 33 | $this->addSchema(); |
||
| 34 | $this->assertArrayNotHasKey('debug', $this->executor->disabledDebugInfo()->execute($this->request)->extensions); |
||
| 35 | } |
||
| 36 | |||
| 37 | public function testEnabledDebugInfo() |
||
| 38 | { |
||
| 39 | $this->addSchema(); |
||
| 40 | $result = $this->executor->enabledDebugInfo()->execute($this->request); |
||
| 41 | |||
| 42 | $this->assertArrayHasKey('debug', $result->extensions); |
||
| 43 | $this->assertArrayHasKey('executionTime', $result->extensions['debug']); |
||
| 44 | $this->assertArrayHasKey('memoryUsage', $result->extensions['debug']); |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @expectedException \RuntimeException |
||
| 49 | * @expectedExceptionMessage At least one schema should be declare. |
||
| 50 | */ |
||
| 51 | public function testGetSchemaNoSchemaFound() |
||
| 55 | |||
| 56 | private function addSchema() |
||
| 72 | } |
||
| 73 |