Commit graph

84 commits

Author SHA1 Message Date
95ee51563d First battery of SQLite driver tests 2017-03-08 22:16:35 -05:00
7f7d0cd1e7 All test for constraint violation exception 2017-03-08 13:59:20 -05:00
5ba38fc7aa Print ID in exception message 2017-03-08 12:31:45 -05:00
a3e2da1d36 Flesh out most database exceptions
- Fixes #46
- Some exception messages are tentative pending testing
2017-03-08 12:29:22 -05:00
7c1df71acd Make db throw specific exceptions
Needs testing and fleshing out; not all exception codes and messages have been defined
2017-03-08 09:55:16 -05:00
755c976aa4 Remove extraneous files 2017-03-08 08:21:48 -05:00
fa247b34f6 Reduce the number of database exception types 2017-03-08 08:19:42 -05:00
7687109132 Reorganize Db namespace; alter User ns to match 2017-03-07 18:01:13 -05:00
37dad63dee Impelemented Result->getAll()
- Fixes #45
- Renamed getSingle to getValue to avoid possible confusion
- Added test to ensure getValue() always returns the first datum of each row rather than going column-to-column
2017-03-06 16:34:38 -05:00
1dab15c20e Fix SQLite3 driver name 2017-03-04 20:03:41 -05:00
eeb1818bb5 Still more database changes
- Restructured tests
- Localized driver name for SQLite driver (fixes #37)
- Ensured that binding type definitions are required
2017-03-03 13:20:26 -05:00
2b7a236147 More database fixes
Now able to add feeds to the database
2017-03-02 22:43:59 -05:00
007e3747ef Various database fixes
Authentication appears to be broken with a real database
2017-03-02 20:47:00 -05:00
0c410fcf50 More binding tests and related changes
- Introduced abstract Statement class to hold common methods
- Common methods currently consist of a date formatter and type caster
- Moved binding tests to a trait for reuse with future drivers
2017-03-02 18:42:19 -05:00
1529fc367a Partial proper tests for parameter bindings
Null and (>0) integer tested so far

Many related changes to accomodate the necessary type juggling (required for databases other than SQLite).
2017-03-02 14:19:16 -05:00
337b2cf90c Remove last vestiges of PDO accomodation 2017-03-02 09:04:04 -05:00
f19f683e38 Make it possible to redefine Statement type binds 2017-03-01 23:12:42 -05:00
b4d178c33f Remove most PDO stuff
PDO will not be supported: the feature-set is less than any of the common native APIs, so why bother?
2017-03-01 22:47:51 -05:00
176247894d Tests for Db\ResultSQLite3 2017-03-01 19:00:14 -05:00
34c69fbf92 Be explicit about the loaded locale 2017-03-01 12:13:38 -05:00
104f646973 Code comments 2017-03-01 08:38:44 -05:00
13c17f5dd4 Small fixes to authorization exception tests 2017-02-28 14:04:14 -05:00
447fec993f Refector authorization exception tests 2017-02-28 13:10:04 -05:00
8841da9cbb Tweak authorization exception tests 2017-02-28 12:54:48 -05:00
2c9f6bd5a7 Cover authorization exceptions
Check each of the current User class features and ensure they trigger an exception when they should and do not when they shouldn't.  Tests check against both an internal and external mock driver
2017-02-28 12:37:45 -05:00
766f2b65a4 Cover unknown/invalid user levels 2017-02-28 11:19:33 -05:00
7ae3c978b3 Full set of tests for authorization
Invalid/unknown rights levels still need better testing.
2017-02-28 10:52:02 -05:00
000781dc36 Cover blank passwords in existing tests 2017-02-27 23:28:11 -05:00
e4852b581a Start on tests for authorization 2017-02-27 23:04:13 -05:00
44c2ff5b07 Speed up tests by only hashing passwords when needed 2017-02-27 16:47:20 -05:00
a039e104cf Allow inspection of the mock internal database
This will allow testing of auto-provisioning in the internal database when using external drivers
2017-02-27 11:44:20 -05:00
ce3ddee00a Whitespace fixes 2017-02-27 08:05:10 -05:00
798d7e7ab7 Added synthetic tests for external User drivers
Fixed two typos in external driver handling
2017-02-26 22:06:14 -05:00
b6a47fc366 Abstract synthetic User backend for later tests 2017-02-26 12:09:44 -05:00
1834cb9963 Last of the basic tests for the User class 2017-02-25 12:59:39 -05:00
be9ebf9ca1 Remove authz from User driver; moved to main class 2017-02-22 23:22:45 -05:00
d8f2440eeb Remove dead code 2017-02-20 22:10:25 -05:00
8a0d021622 More User tests and resultant fixes 2017-02-20 19:04:08 -05:00
7785eb072b Complete rewrite of User class and other changes
- User-related database methods will now throw User\Exception upon errors
- Internal userAdd method can now generate random passwords
- Pursuant to above, dependency on password genrator has been added, and password-related methods now return strings instead of booleans
- User class methods now all explicitly follow different branches for internal/external/missing implementations
- various User class methods now perform auto-provisioning of the internal database when external implementations report success on users not in the database
- Tests have been adjusted to account for the above changes
- Lots is probably still broken
2017-02-20 17:04:13 -05:00
26989facfe More PicoFeed Integration Bug fixes
• Fixed a bug where the feed object’s variable was being reused as the
id for adding feeds to subscriptions
• Modified inline documentation
• Added a TODO for populating the articles table when adding a new feed
2017-02-20 11:58:26 -06:00
cb664eab03 Minor fixes to PicoFeed integration 2017-02-19 18:33:03 -06:00
e5d825d360 Started integration of PicoFeed
• Integrated PicoFeed into Database->subscriptionAdd
• Added exception handling for feeds
• Added static method for formatting SQL dates into Db/Common
2017-02-19 16:02:03 -06:00
e6feb8de8d First basic test for User class
As the User class depends on the database and this has yet to be tested (though I'm fairly certain it works), the mock driver also acts as a mock of the required database functions, with both instances sharing a common storage structure. Later test series should separate the two.
2017-02-19 00:22:16 -05:00
574388665a Tidy up tests and User stuff
- Skeleton of mock internal driver
- Skeleton of test suite
- Re-arranged lots of code
- Made drive name localized (improves #37)
2017-02-17 19:22:50 -05:00
8db31cf3e4 Tweaked Lang; added comments and tests
Tweaks:
- get() method can now report loaded and well as wanted locale
- msg() passed without vars still gets formatted to catch malformed strings
- set('en', false) followed by set('en', true) will now immediately load
- Lang::$synched was not getting set to true properly

Tests:
- Added test for get()
- Added test for malformed strings (exception code was missing)
- Added test for missing strings
- Added test for strings taking variables not being passed any variables
2017-02-16 17:50:34 -05:00
555babe84b Updated composer.lock file for picofeed 2017-02-16 15:41:50 -05:00
c5fac33398 Converted all hard tabs to soft tabs 2017-02-16 14:29:42 -06:00
8afa1cb5bb Class names from classes themselves in defaults 2017-02-16 15:14:15 -05:00
f302861662 Added ETag to SQL schema and picoFeed as requirement in composer 2017-02-16 14:09:41 -06:00
8e2a2c46b1 Refactor test infrastructure to use PSR-4. 2017-02-14 22:34:08 -05:00