Skip to content

Commit 65f64f1

Browse files
committed
test case added for GraphQL Query
1 parent 7233f96 commit 65f64f1

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

tests/GraphQLTest.php

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
namespace PHPShopify;
4+
5+
class GraphQLTest extends TestResource
6+
{
7+
/**
8+
* GraphQLTest constructor.
9+
*/
10+
public function __construct()
11+
{
12+
parent::__construct();
13+
}
14+
15+
16+
/**
17+
* GraphQL Query Test
18+
*/
19+
public function testQuery()
20+
{
21+
$graphQL = <<<Query
22+
query {
23+
shop {
24+
name
25+
primaryDomain {
26+
url
27+
host
28+
}
29+
}
30+
}
31+
Query;
32+
33+
$return = static::$shopify->GraphQL->post($graphQL);
34+
35+
$this->assertNotEmpty($return['data']['shop']);
36+
}
37+
38+
39+
}

0 commit comments

Comments
 (0)