Commit graph

145 commits

Author SHA1 Message Date
4a816f827b NCNv1 feed calls and other changes
- Implemented all but one feed-related function (it's more ofan item function)
- Fixed time conversion for input into SQL; dates in PM were previously wrong
- Added miscellaneous tentative functions to Database to help with peculiarities of NCNv1; these may change
- Tests to come soon
2017-05-18 23:03:33 -04:00
0bc2841837 Last of subscription tests
- Also tweaked SQL dateformat() function to output proper HTTP dates
- Also introduced method to set a default output date format
2017-05-18 13:21:17 -04:00
99ae274ef8 Also test negative read marks 2017-05-16 22:24:36 -04:00
ef3cb4fa54 Test unread counts in subscriptionList 2017-05-16 22:19:40 -04:00
f635155687 Basic tests for subscription list
- Need entries and read marks to fully test
- Added assertion type to test result subsets
- Fixed custom subscription titles
2017-05-14 23:03:48 -04:00
acbb254bfb Tests for removing subscriptions 2017-05-11 23:20:10 -04:00
98c950de58 Removed most calls to userExists()
- functions not related to user management now have the existence of the affected user checked in the authorizer, when the affected user differs from the actor
- User::authorizationEnabled() now nests: disabling twice and then enabling once leaves the authorizer disabled
- Disabling of the authorizer is now tested
- User tests now use a partial mock instead of relying on User::authorizationEnabled()
- Added authorizer tests against a missing user
- Removed folder tests related to missing users
- Also added more subscription tests
2017-05-11 18:00:35 -04:00
a580579627 First set of Database subscription tests 2017-05-10 22:01:00 -04:00
554beacfdb Improved database tests
- Centralized initial state; this will be useful due to foreign key interdependence
- Added nextID() method to make insert tests less brittle
2017-05-10 21:21:23 -04:00
2083c6e397 Change transactions to auto-rollback on exceptions 2017-05-06 12:02:27 -04:00
fb922e65e4 Tests for strict binding 2017-05-04 19:38:54 -04:00
717e74fb2e Refactored special case for testing 2017-05-03 20:00:29 -04:00
a67fe30408 Fix whitespace
Also fixed my editor so tabs won't happen again!
2017-04-06 21:41:21 -04:00
19abce85c3 Implement NCN API v1-2 folder creation
- Fixes #4
- Tests for failure modes still required
2017-04-02 12:14:15 -04:00
842e277d43 Implemented NCN API v1-2 folder list
- Fixes #2
- Also re-organized REST handling
2017-04-01 23:06:52 -04:00
718c5a04dd Add authz verification to folder tests 2017-04-01 15:06:34 -04:00
1e1b848c62 Remove root field from folders table
The field is no longer required with the use of recursive common table expressions, and  presents a possible loss of referential integrity
2017-04-01 14:49:31 -04:00
a111bcc231 Folder get/set prop funcs and other changes
- Simplified folder removal; now properly relies on foreign keys for dependency resolution
- simplified *propertiesSet() methods by offloading input validation and query building to a generic function
- Implemented function to get the properties of a single folder (useful for internal use)
- Implemented a function to set the properties of a folder
2017-04-01 10:27:26 -04:00
2344911f78 Tests for removing folders 2017-03-31 18:48:24 -04:00
458eaac5c6 Tests for listing folders
- Fixed checking for existence of parent before listing
- Changed Result->getAll() to return an empty array rather than null for an empty result set
2017-03-31 17:42:28 -04:00
b68cea1188 Tests for adding folders 2017-03-31 15:27:59 -04:00
82e4838162 Re-organize Database tests
- Test files now consist entirely of traits:
 - General setup trait mocking User class and cleaning up
 - Driver trait to set up the database connection
 - Series trait containing tests for the series, independent of driver used
2017-03-31 13:24:00 -04:00
dbd735f1f3 Full set of tests for user-related Database funcs
- Fixed a few inconsistencies and bugs along the way
- User manager tests need some equivalent fleshing out
2017-03-29 23:41:05 -04:00
6b2be0a877 Use Phake to create mock objects in tests 2017-03-28 20:30:40 -04:00
6bb129db2f Mock correct method of Lang 2017-03-28 19:58:20 -04:00
f902346b6c Eliminated passing of RuntimeData instances
- RuntimeData has now been replaced by a single static Data class
- The Data class has a load() method which fills the same role as the constructor of RuntimeData
- The static Lang class is now an instantiable class and is a member of Data
- All tests have been adjusted and pass
- The Exception tests no longer require convoluted workarounds: a simple mock  for Data::$l suffices; Lang tests also use a mock to prevent loops now instead of using a workaround
2017-03-28 18:50:00 -04:00
2b8aa75ee3 Row index is not a string 2017-03-28 10:31:49 -04:00
7236020b8b Changed "NewsSync" to "Arsse" 2017-03-27 23:12:12 -05:00
9d5dab249c Helper methods for testing Database class
May not actually work yet
2017-03-27 23:19:05 -04: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
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
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
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
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
be9ebf9ca1 Remove authz from User driver; moved to main class 2017-02-22 23:22:45 -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
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
c5fac33398 Converted all hard tabs to soft tabs 2017-02-16 14:29:42 -06:00
8e2a2c46b1 Refactor test infrastructure to use PSR-4. 2017-02-14 22:34:08 -05:00