Commit Graph

27 Commits

Author SHA1 Message Date
Kirk Bushell
1b3d674c39 Added tests for invalid confirmation token handling 2015-10-27 14:47:03 +00:00
Kirk Bushell
400aa4fef9 Added more tests 2015-10-27 13:22:30 +00:00
Kirk Bushell
a4ef9e7cf4 Added output test for flooding exception handler 2015-10-27 12:54:10 +00:00
Kirk Bushell
f230c72ebb Fied broken test 2015-10-27 12:50:11 +00:00
Kirk Bushell
f0883471ef Updated tests namespace to be ps4-valid. Added tests for flooding exception, fixed broken code 2015-10-27 12:48:27 +00:00
Toby Zerner
ddfedcb4dd Add Interface suffix to SettingsRepository 2015-10-19 14:58:47 +10:30
Toby Zerner
b53e612007 Fix failing tests + CS 2015-10-11 23:37:51 +10:30
Toby Zerner
dd67291ce0 Major refactor and improvements
- Reorganised all namespaces and class names for consistency and structure. Following PSR bylaws (Abstract prefix, Interface/Trait suffix).
  - Move models into root of Core, because writing `use Flarum\Core\Discussion` is nice. Namespace the rest by type. (Namespacing by entity was too arbitrary.)
  - Moved some non-domain stuff out of Core: Database, Formatter, Settings.
  - Renamed config table and all references to "settings" for consistency.
  - Remove Core class and add url()/isInstalled()/inDebugMode() as instance methods of Foundation\Application.
  - Cleanup, docblocking, etc.

- Improvements to HTTP architecture
  - API and forum/admin Actions are now actually all the same thing (simple PSR-7 Request handlers), renamed to Controllers.
  - Upgrade to tobscure/json-api 0.2 branch.
  - Where possible, moved generic functionality to tobscure/json-api (e.g. pagination links). I'm quite happy with the backend balance now re: #262

- Improvements to other architecture
  - Use Illuminate's Auth\Access\Gate interface/implementation instead of our old Locked trait. We still use events to actually determine the permissions though. Our Policy classes are actually glorified event subscribers.
  - Extract model validation into Core\Validator classes.
  - Make post visibility permission stuff much more efficient and DRY.

- Renamed Flarum\Event classes for consistency. ref #246
  - `Configure` prefix for events dedicated to configuring an object.
  - `Get` prefix for events whose listeners should return something.
  - `Prepare` prefix when a variable is passed by reference so it can be modified.
  - `Scope` prefix when a query builder is passed.

- Miscellaneous improvements/bug-fixes. I'm easily distracted!
  - Increase default height of post composer.
  - Improve post stream redraw flickering in Safari by keying loading post placeholders with their IDs. ref #451
  - Use a PHP JavaScript minification library for minifying TextFormatter's JavaScript, instead of ClosureCompilerService (can't rely on external service!)
  - Use UrlGenerator properly in various places. closes #123
  - Make Api\Client return Response object. closes #128
  - Allow extensions to specify custom icon images.
  - Allow external API/admin URLs to be optionally specified in config.php. If the value or "url" is an array, we look for the corresponding path inside. Otherwise, we append the path to the base URL, using the corresponding value in "paths" if present. closes #244
2015-10-08 14:28:02 +10:30
kirkbushell
b179ca1c48 Added tests for admin login/cookie checks 2015-09-28 16:02:37 +01:00
kirkbushell
c3374197d1 Added zend-stragility (missing), removed some redundant code. 2015-09-28 15:59:07 +01:00
kirkbushell
a00226c05a Added some tests for the database setting repository 2015-09-28 15:34:32 +01:00
kirkbushell
7706714ad9 Removed phpsec as the testing library, added phpunit and converted the first spec test to phpunit format. Also added mockery. 2015-09-28 15:09:13 +01:00
Toby Zerner
7706914b33 Get rid of Codeception for now
There's nothing in there that's of value.
2015-07-18 10:55:30 +09:30
Franz Liedke
d1cd4b174b Remove last remaining usage of DB facade 2015-06-09 02:40:02 +02:00
Maksim Knyshov
1bd69f80c7 Remove unneeded .gitkeep's 2015-03-31 22:38:15 +03:00
Toby Zerner
2c46888db5 Upgrade to L5 + huge refactor + more. closes #2
New stuff:
- Signup + email confirmation.
- Updated authentication strategy with remember cookies. closes #5
- New search system with some example gambits! This is cool - check out
the source. Fulltext drivers will be implemented as decorators
overriding the EloquentPostRepository’s findByContent method.
- Lay down the foundation for bootstrapping the Ember app.
- Update Web layer’s asset manager to properly publish CSS/JS files.
- Console commands to run installation migrations and seeds.

Refactoring:
- New structure: move models, repositories, commands, and events into
their own namespaces, rather than grouping by entity.
- All events are classes.
- Use L5 middleware and command bus implementations.
- Clearer use of repositories and the Active Record pattern.
Repositories are used only for retrieval of ActiveRecord objects, and
then save/delete operations are called directly on those ActiveRecords.
This way, we don’t over-abstract at the cost of Eloquent magic, but
testing is still easy.
- Refactor of Web layer so that it uses the Actions routing
architecture.
- “Actor” concept instead of depending on Laravel’s Auth.
- General cleanup!
2015-02-24 20:33:18 +10:30
Toby Zerner
28d213d868 Implement discussion composition and creation 2015-02-06 14:07:15 +10:30
Toby Zerner
e37d3743ed Use our own token instead of Laravel's
Laravel’s remember_token is tied to the session/cookies, which we don’t
need as the API is stateless. It makes much more sense to use our own
token mechanism.
2015-01-30 12:08:02 +10:30
Toby Zerner
b57a8d3bc2 Improve auth API tests 2015-01-23 15:24:38 +10:30
Toby Zerner
ad269fdb5a Implement token-based auth API 2015-01-22 14:44:33 +10:30
Allineer
823a3f0e82 [proposal] cameCase in the test names
Sorry :)
2015-01-22 01:42:47 +03:00
Toby Zerner
21863759e6 Improve discussions API tests 2015-01-21 12:23:10 +10:30
Toby Zerner
c91c1518d5 Integration tests for DiscussionRepository
Also add some TestDummy factories (needs more work)
2015-01-21 12:22:20 +10:30
Toby Zerner
586cb9b00d Update todo list, add screenshot 2015-01-20 15:07:38 +10:30
Toby Zerner
2fcb1dc7c8 Begin testing API (see #3) 2015-01-19 20:46:14 +10:30
Mike Dugan
bf94197dcd add codeception, update gitignore 2014-12-22 08:28:01 -05:00
Toby Zerner
74db323f83 Hello world! 2014-12-20 16:56:46 +10:30