Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dragomano committed Dec 25, 2024
1 parent 864167e commit 550a49d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/Pest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
Utils::$smcFunc['db_fetch_all'] = fn(...$params) => [];
Utils::$smcFunc['db_free_result'] = fn(...$params) => true;
Utils::$smcFunc['db_insert'] = fn(...$params) => 0;
Utils::$smcFunc['db_insert_id'] = fn(...$params) => 1;
Utils::$smcFunc['db_num_rows'] = fn(...$params) => 0;
Utils::$smcFunc['db_affected_rows'] = fn(...$params) => 0;
Utils::$smcFunc['db_transaction'] = fn(...$params) => true;
Utils::$smcFunc['db_optimize_table'] = fn(...$params) => 0;
Utils::$smcFunc['db_list_tables'] = fn(...$params) => [];
Expand Down
10 changes: 10 additions & 0 deletions tests/Unit/DbFuncMapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@
->toBeInt();
});

test('insert_id method', function () {
expect($this->db->insert_id(''))
->toBeInt();
});

test('affected_rows method', function () {
expect($this->db->affected_rows())
->toBeInt();
});

test('transaction method', function () {
expect($this->db->transaction())
->toBeTrue();
Expand Down

0 comments on commit 550a49d

Please sign in to comment.