mikecao / sparrow

A simple database toolkit for PHP
MIT License
289 stars 68 forks source link

Tests #12

Open rooduck opened 10 years ago

rooduck commented 10 years ago

Hi Mike. Do you have tests or something like that for sparrow? I made a small patch to your project but want to be sure that everything is fine.

mikecao commented 10 years ago

I don't have any tests currently. I doing a rewrite to make it more object oriented and that project has tests, but I haven't released it yet.

If you want you and submit a pull request and I'll verify the code.

rooduck commented 10 years ago

Ok, thank you.

My IDE also notifies about two problems i did'nt try to solve:

Line 863 $result = sqlite_query($this->db, $this->sql, SQLITE_ASSOC, $error); Error in SQLITE_ASSOC: Only variables can be passed by reference

Line 1368 xcache_clear_cache(); Required parameter $type missing.

I think you should check that.

If you need some suggestions for your new project, i would be happy to see not only CRUD operations, but also CREATE, DROP etc., and i'm not really sure you need cache manager in your toolkit. Usually the one who uses cache needs it not only for queries, but also for pages, API answers and other things. I prefer one small database toolkit and one small cache toolkit that covers all my needs instead of one database toolkit with cache that i cannot use and one additional cache toolkit (often with ORM-functions i dont need). But that's only my opinion.