Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: insert error message in QueryBuilder #6108

Merged
merged 1 commit into from
Jun 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion system/Database/BaseBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -1923,7 +1923,7 @@ protected function validateInsert(): bool
{
if (empty($this->QBSet)) {
if (CI_DEBUG) {
throw new DatabaseException('You must use the "set" method to update an entry.');
throw new DatabaseException('You must use the "set" method to insert an entry.');
}

return false; // @codeCoverageIgnore
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Database/Builder/InsertTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function testThrowsExceptionOnNoValuesSet()
$builder = $this->db->table('jobs');

$this->expectException(DatabaseException::class);
$this->expectExceptionMessage('You must use the "set" method to update an entry.');
$this->expectExceptionMessage('You must use the "set" method to insert an entry.');

$builder->testMode()->insert(null, true);
}
Expand Down