diff --git a/tests/Pest.php b/tests/Pest.php index 29219f2..f54fcf4 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -24,7 +24,6 @@ Utils::$smcFunc['htmlspecialchars'] = fn(...$params) => htmlspecialchars(...$params); Utils::$smcFunc['db_query'] = fn(...$params) => new \stdClass(); - Utils::$smcFunc['db_search_query'] = Utils::$smcFunc['db_query']; Utils::$smcFunc['db_fetch_row'] = fn(...$params) => []; Utils::$smcFunc['db_fetch_assoc'] = fn(...$params) => []; Utils::$smcFunc['db_fetch_all'] = fn(...$params) => []; @@ -32,7 +31,10 @@ Utils::$smcFunc['db_insert'] = fn(...$params) => 0; Utils::$smcFunc['db_num_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) => []; Utils::$smcFunc['db_get_version'] = fn(...$params) => ''; + Utils::$smcFunc['db_create_table'] = fn(...$params) => false; })->in(__DIR__); /* diff --git a/tests/Unit/DbFuncMapperTest.php b/tests/Unit/DbFuncMapperTest.php index 7ca444f..28b7ec6 100644 --- a/tests/Unit/DbFuncMapperTest.php +++ b/tests/Unit/DbFuncMapperTest.php @@ -15,11 +15,6 @@ ->toEqual(Utils::$smcFunc['db_query'](...$this->params)); }); -test('search_query method', function () { - expect($this->db->search_query(...$this->params)) - ->toEqual(Utils::$smcFunc['db_search_query'](...$this->params)); -}); - test('fetch_row method', function () { expect($this->db->fetch_row($this->resourse)) ->toBeArray(); @@ -45,7 +40,27 @@ ->toBeTrue(); }); +test('optimize_table method', function () { + expect($this->db->optimize_table('')) + ->toBeInt(); +}); + +test('list_tables method', function () { + expect($this->db->list_tables()) + ->toBeArray(); +}); + test('get_version method', function () { expect($this->db->get_version()) ->toBeString(); }); + +test('create_table method', function () { + expect($this->db->create_table('', [])) + ->toBeFalse(); +}); + +test('__call method', function () { + expect($this->db->unknown($this->params)) + ->toBeFalse(); +});