ezSQL / ezsql

PHP class to make interacting with a database ridiculusly easy
http://ezsql.github.io/ezsql
GNU Lesser General Public License v3.0
866 stars 291 forks source link

fixBug: Conditional Stacked Functions in selecting #175

Closed dpDesignz closed 4 years ago

dpDesignz commented 5 years ago

Fixes ezSQL#174 Removed check for $columnFields being empty, and added dots between table and column names in query builder

codecov-io commented 5 years ago

Codecov Report

Merging #175 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #175   +/-   ##
=========================================
  Coverage     83.56%   83.56%           
- Complexity      788      793    +5     
=========================================
  Files            14       14           
  Lines          2002     2002           
=========================================
  Hits           1673     1673           
  Misses          329      329
Impacted Files Coverage Δ Complexity Δ
lib/Database.php 78.57% <100%> (ø) 17 <13> (+5) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e73a3de...52af9bd. Read the comment docs.

dpDesignz commented 5 years ago

@techno-express I've made some more adjustments to the joins to allow more flexibility. For some reason there are conflicts identified by GitHub which aren't in my original code though? Not sure if they're actually an issue or not.

TheTechsTech commented 5 years ago

You might want to do an local merge/update off master. I made some psr-2 fixes, commits, that is the reason for the conflicts.

Also, take a look at how some of the phpunit tests i have for help on constructing/creating your test.

dpDesignz commented 5 years ago

Oh, that didn't show up in my sync for some reason. Will try and update my local version (still trying to work out how to do this properly. I use GitHub Desktop.) and then take a look at the changes again :)

dpDesignz commented 5 years ago

@techno-express sorry for all the commits. Just getting my head around using the new GitHub desktop interface and my VS-Code config. Finally got it all sorted and fixed all the conflicts as well as some more small bugs I found. 😄

All ready for merge.

TheTechsTech commented 5 years ago

Where is the test?

Can't really merge until then, someone else might come along raising some issue related to JOINS not working, or whatever. As with others submitting issues, i eventually point them to the tests showing not an issue with library cause the phpunit tests covers that.

There is no proof showing it works.

dpDesignz commented 5 years ago

Sorry, I haven't had a chance to look at how phpunit works and I don't have the time to learn it at this stage. Will just have to leave this for now.

TheTechsTech commented 5 years ago

Ok, when you are ready, it's really not that much to learn.

You would just add a method to https://github.com/ezSQL/ezsql/blob/master/tests/mysqli/mysqliTest.php prefixing test to it's name. The actually code would look similar to whatever you have written before.

The phpunit just have many methods to compare what you expect, to what the actually result was, like: $this->assertEquals($somethingShouldBe, $actaulDatabaseResult); // this is the actually test.

Look at https://github.com/ezSQL/ezsql/blob/5971a568bf1868803e46bab61399acc3e1a3f416/tests/mysqli/mysqliTest.php#L320

You would be doing the same example test, but with two tables.