-
-
Notifications
You must be signed in to change notification settings - Fork 157
Expand file tree
/
Copy pathListTableMetadataOutputTest.php
More file actions
69 lines (64 loc) · 2.31 KB
/
Copy pathListTableMetadataOutputTest.php
File metadata and controls
69 lines (64 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
namespace AsyncAws\Athena\Tests\Unit\Result;
use AsyncAws\Athena\AthenaClient;
use AsyncAws\Athena\Input\ListTableMetadataInput;
use AsyncAws\Athena\Result\ListTableMetadataOutput;
use AsyncAws\Core\Response;
use AsyncAws\Core\Test\Http\SimpleMockedResponse;
use AsyncAws\Core\Test\TestCase;
use Psr\Log\NullLogger;
use Symfony\Component\HttpClient\MockHttpClient;
class ListTableMetadataOutputTest extends TestCase
{
public function testListTableMetadataOutput(): void
{
self::markTestSkipped('MissingAuthenticationTokenException, No yet Docker image for Athena ');
// see https://docs.aws.amazon.com/athena/latest/APIReference/API_ListTableMetadata.html
$response = new SimpleMockedResponse('{
"NextToken": "iad-tok1n256",
"TableMetadataList": [
{
"Columns": [
{
"Comment": "product name",
"Name": "product_name",
"Type": "string"
}
],
"CreateTime": 1680943083.125,
"LastAccessTime": 1680943085.025,
"Name": "Catalog",
"Parameters": {
"contrib" : "iad"
},
"PartitionKeys": [
{
"Comment": "new one",
"Name": "stagging",
"Type": "string"
}
],
"TableType": "EXTERNAL_TABLE"
}
]
}');
$client = new MockHttpClient($response);
$result = new ListTableMetadataOutput(
new Response(
$client->request(
'POST',
'http://localhost'),
$client,
new NullLogger()),
new AthenaClient(),
new ListTableMetadataInput([
'CatalogName' => 'iadCatalog',
'DatabaseName' => 'iadDatabase',
])
);
self::assertIsIterable($result->getTableMetadataList());
self::assertCount(1, $result->getTableMetadataList());
self::assertArrayHasKey('TableType', $result->getTableMetadataList());
self::assertSame('iad-tok1n256', $result->getNextToken());
}
}