PLAT-170 Adding tests 4 changes to DatabaseBase.

Adding tests for the changes to DatabaseBase. I added a new path under
tests/unit/includes/db as this should be a proper unit test and so I
don't think belongs in tests/phpunit/includes/db/DatabaseTest.php. The
core tests are also broken and have unwanted side effects (like dropping
the users table).
PLAT-170 changed sample to shouldSample ...

Changed sample to shouldSample. I think this will improve the
readability where it's used.

Changed the range checking of the probability provided to a check that
will throw an exception.