1
1
Fork 0
mirror of https://code.mensbeam.com/MensBeam/Arsse.git synced 2024-12-23 17:12:41 +00:00
Commit graph

68 commits

Author SHA1 Message Date
J. King
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
J. King
6b2be0a877 Use Phake to create mock objects in tests 2017-03-28 20:30:40 -04:00
J. King
6bb129db2f Mock correct method of Lang 2017-03-28 19:58:20 -04:00
J. King
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
J. King
2b8aa75ee3 Row index is not a string 2017-03-28 10:31:49 -04:00
Dustin Wilson
7236020b8b Changed "NewsSync" to "Arsse" 2017-03-27 23:12:12 -05:00
J. King
9d5dab249c Helper methods for testing Database class
May not actually work yet
2017-03-27 23:19:05 -04:00
J. King
8b50297e6d Complete tests for NCN version list
- Fixes #47
- Implemented an AbstractHandler class with a generic URL parser
2017-03-24 13:16:34 -04:00
J. King
25d9158171 Fix output of NCN version list
List is supposed to be contained in a JSON object, not a bare list
2017-03-19 21:54:28 -04:00
J. King
536fa5c4fd Implement NextCloud News version detection
- Improves #47
- Still needs wrapping to actually output to clients
2017-03-19 21:50:00 -04:00
J. King
20abd277eb Don't muck with test file for now 2017-03-18 22:32:16 -04:00
J. King
9a8def03c2 Fill in more of the REST handler.
Not yet functional.
2017-03-18 22:30:36 -04:00
J. King
8c268581fb Properly handle adding a folder
Also added test file for now
2017-03-09 22:41:11 -05:00
J. King
18c8076a0f Database update tests 2017-03-09 21:39:42 -05:00
J. King
6c16ba133c More database driver tests 2017-03-09 17:25:50 -05:00
J. King
689c1c77d0 Test for advisory locking 2017-03-09 17:14:26 -05:00
J. King
f0663e99c3 Add tests for transactions and savepoints
Existing code had subtle bugs; using increment and decrement operators actually makes things easier to understand (for once)
2017-03-09 16:36:33 -05:00
J. King
485400df2b Rename Result->get() to Result->getRow
It should be slightly clearer what it does
2017-03-09 15:01:18 -05:00
J. King
bdf3182305 Add result->lastId method; cleanup
- Result->lastId() added as MySQL and PostgreSQL have equivalent functionality
- Adjusted tests accordingly
- Cleaned up Database class to make use of this and getAll()
2017-03-09 14:48:42 -05:00
J. King
f0adf08b1e Add tests for type mismatches 2017-03-09 09:44:50 -05:00
J. King
95ee51563d First battery of SQLite driver tests 2017-03-08 22:16:35 -05:00
J. King
7f7d0cd1e7 All test for constraint violation exception 2017-03-08 13:59:20 -05:00
J. King
7687109132 Reorganize Db namespace; alter User ns to match 2017-03-07 18:01:13 -05:00
J. King
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
J. King
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
J. King
007e3747ef Various database fixes
Authentication appears to be broken with a real database
2017-03-02 20:47:00 -05:00
J. King
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
J. King
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
J. King
f19f683e38 Make it possible to redefine Statement type binds 2017-03-01 23:12:42 -05:00
J. King
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
J. King
176247894d Tests for Db\ResultSQLite3 2017-03-01 19:00:14 -05:00
J. King
34c69fbf92 Be explicit about the loaded locale 2017-03-01 12:13:38 -05:00
J. King
104f646973 Code comments 2017-03-01 08:38:44 -05:00
J. King
13c17f5dd4 Small fixes to authorization exception tests 2017-02-28 14:04:14 -05:00
J. King
447fec993f Refector authorization exception tests 2017-02-28 13:10:04 -05:00
J. King
8841da9cbb Tweak authorization exception tests 2017-02-28 12:54:48 -05:00
J. King
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
J. King
766f2b65a4 Cover unknown/invalid user levels 2017-02-28 11:19:33 -05:00
J. King
7ae3c978b3 Full set of tests for authorization
Invalid/unknown rights levels still need better testing.
2017-02-28 10:52:02 -05:00
J. King
000781dc36 Cover blank passwords in existing tests 2017-02-27 23:28:11 -05:00
J. King
e4852b581a Start on tests for authorization 2017-02-27 23:04:13 -05:00
J. King
44c2ff5b07 Speed up tests by only hashing passwords when needed 2017-02-27 16:47:20 -05:00
J. King
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
J. King
ce3ddee00a Whitespace fixes 2017-02-27 08:05:10 -05:00
J. King
798d7e7ab7 Added synthetic tests for external User drivers
Fixed two typos in external driver handling
2017-02-26 22:06:14 -05:00
J. King
b6a47fc366 Abstract synthetic User backend for later tests 2017-02-26 12:09:44 -05:00
J. King
1834cb9963 Last of the basic tests for the User class 2017-02-25 12:59:39 -05:00
J. King
be9ebf9ca1 Remove authz from User driver; moved to main class 2017-02-22 23:22:45 -05:00
J. King
8a0d021622 More User tests and resultant fixes 2017-02-20 19:04:08 -05:00
J. King
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