Skip to content

Commit af815c5

Browse files
committed
Fix after rebase
1 parent 958cfd2 commit af815c5

2 files changed

Lines changed: 42 additions & 0 deletions

File tree

tests/Backend/CommonPart1/CreateTableTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,30 @@ public function testTableCreate($tableName, $createFile, $expectationFile, $asyn
7474
$tableUpdateOptions = new TableUpdateOptions($tableId, $displayName);
7575
$this->_client->updateTable($tableUpdateOptions);
7676

77+
try {
78+
$tableId = $this->_client->{$createMethod}(
79+
$this->getTestBucketId(self::STAGE_IN),
80+
$displayName,
81+
new CsvFile($createFile),
82+
$options
83+
);
84+
$this->fail('Should fail');
85+
} catch (\Keboola\StorageApi\ClientException $e) {
86+
$this->assertEquals(
87+
sprintf(
88+
'The table "%s" in the bucket already has the same display name "%s".',
89+
$table['name'],
90+
$displayName
91+
),
92+
$e->getMessage()
93+
);
94+
$this->assertEquals('storage.buckets.tableAlreadyExists', $e->getStringCode());
95+
}
96+
7797
try {
7898
$tableUpdateOptions = new TableUpdateOptions($tableId, '_wrong-display-name');
7999
$this->_client->updateTable($tableUpdateOptions);
100+
$this->fail('Should fail');
80101
} catch (\Keboola\StorageApi\ClientException $e) {
81102
$this->assertEquals(
82103
'Invalid data - displayName: Cannot start with underscore.',

tests/Backend/Synapse/CreateTableTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,30 @@ public function testTableCreate($tableName, $createFile, $expectationFile, $asyn
6565
$tableUpdateOptions = new TableUpdateOptions($tableId, $displayName);
6666
$this->_client->updateTable($tableUpdateOptions);
6767

68+
try {
69+
$tableId = $this->_client->{$createMethod}(
70+
$this->getTestBucketId(self::STAGE_IN),
71+
$displayName,
72+
new CsvFile($createFile),
73+
$options
74+
);
75+
$this->fail('Should fail');
76+
} catch (\Keboola\StorageApi\ClientException $e) {
77+
$this->assertEquals(
78+
sprintf(
79+
'The table "%s" in the bucket already has the same display name "%s".',
80+
$table['name'],
81+
$displayName
82+
),
83+
$e->getMessage()
84+
);
85+
$this->assertEquals('storage.buckets.tableAlreadyExists', $e->getStringCode());
86+
}
87+
6888
try {
6989
$tableUpdateOptions = new TableUpdateOptions($tableId, '_wrong-display-name');
7090
$this->_client->updateTable($tableUpdateOptions);
91+
$this->fail('Should fail');
7192
} catch (\Keboola\StorageApi\ClientException $e) {
7293
$this->assertEquals(
7394
'Invalid data - displayName: Cannot start with underscore.',

0 commit comments

Comments
 (0)