Skip to content

Commit

Permalink
test: cover wrong number of columns passed on insert (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
simPod authored Jan 16, 2024
1 parent e07f4a8 commit 00da18d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion infection.json.dist
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
},
"text": "infection-log.txt"
},
"minMsi": 85,
"minMsi": 90,
"minCoveredMsi": 96
}
27 changes: 27 additions & 0 deletions tests/Client/InsertTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,31 @@ public function testInsertToNonExistentTableExpectServerError(): void

$this->client->insert('table', [[1]]);
}

public function testInsertWithWrongColumns(): void
{
$tableSql = <<<'CLICKHOUSE'
CREATE TABLE UserActivity (
PageViews UInt32,
UserID UInt64,
Duration UInt32,
Sign Int8
)
ENGINE Memory
CLICKHOUSE;

$this->client->executeQuery($tableSql);

$this->expectException(ServerError::class);
$this->expectExceptionMessage('SYNTAX_ERROR');

$this->client->insert(
'UserActivity',
[
[5],
[6],
],
['PageViews', 'UserID'],
);
}
}

0 comments on commit 00da18d

Please sign in to comment.