Skip to content

Commit

Permalink
test invalid column
Browse files Browse the repository at this point in the history
  • Loading branch information
jirkasemmler committed Jan 26, 2025
1 parent b3b398f commit e2a076e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/Backend/CommonPart1/DeleteRowsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,27 @@ public function testDeleteRowsMissingValuesShouldReturnUserError(): void
}
}

public function testDeleteRowsOnInvalidColumn(): void
{
$importFile = __DIR__ . '/../../_data/users.csv';
$tableId = $this->_client->createTableAsync($this->getTestBucketId(self::STAGE_IN), 'users', new CsvFile($importFile));

try {
$this->_client->deleteTableRows($tableId, [
'whereFilters' => [
[
'column' => 'notExistingColumn',
'values' => ['PRG'],
],
],
]);
$this->fail('Exception should be thrown');
} catch (\Keboola\StorageApi\ClientException $e) {
$this->assertSame('storage.tables.columnNotExists', $e->getStringCode());
$this->assertSame('Cannot filter by column "notExistingColumn", column does not exist', $e->getMessage());
}
}

public function tableDeleteRowsByFiltersData(): array
{
$yesterday = new \DateTime('-1 day');
Expand Down

0 comments on commit e2a076e

Please sign in to comment.