GraphqlControllerTest::testQuery()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
dl 0
loc 10
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
class GraphqlControllerTest extends AimeosTestAbstract
4
{
5
	public function testQuery()
6
	{
7
		$params = ['site' => 'unittest'];
8
		$body = '{"query":"query {\n  findProduct(code: \"CNC\") {\n    id\n    code\n  }\n}\n","variables":{},"operationName":null}';
9
		$response = $this->action( 'POST', '\Aimeos\Shop\Controller\GraphqlController@indexAction', $params, [], [], [], [], $body );
10
11
		$json = json_decode( $response->getContent(), true );
12
13
		$this->assertResponseOk();
14
		$this->assertNotNull( $json );
15
	}
16
}
17