1
0
mirror of https://github.com/flarum/core.git synced 2025-07-23 09:41:26 +02:00
Commit Graph

30 Commits

Author SHA1 Message Date
Kirk Bushell
8843d84117 Added validation handler tests 2015-10-28 12:46:49 +00:00
Kirk Bushell
74c756a8ba Added tests for permission denied exception handler 2015-10-28 12:41:28 +00:00
Kirk Bushell
52b75e4dd7 Added model not found error handler tests 2015-10-28 12:39:38 +00:00
Kirk Bushell
b54f56a683 Added tests for invalid confirmation token handling 2015-10-27 14:47:03 +00:00
Kirk Bushell
765b894084 Added more tests 2015-10-27 13:22:30 +00:00
Kirk Bushell
47a9787116 Added output test for flooding exception handler 2015-10-27 12:54:10 +00:00
Kirk Bushell
903bb27697 Fied broken test 2015-10-27 12:50:11 +00:00
Kirk Bushell
067f87eacb 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
0e06d70b73 Add Interface suffix to SettingsRepository 2015-10-19 14:58:47 +10:30
Toby Zerner
a03dcd4e3f Fix failing tests + CS 2015-10-11 23:37:51 +10:30
Toby Zerner
6bf93ae9f7 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
9198e96385 Added tests for admin login/cookie checks 2015-09-28 16:02:37 +01:00
kirkbushell
a4c61efee2 Added zend-stragility (missing), removed some redundant code. 2015-09-28 15:59:07 +01:00
kirkbushell
a388fe7883 Added some tests for the database setting repository 2015-09-28 15:34:32 +01:00
kirkbushell
b93d5570d0 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
b7264e8a71 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
6994f71757 Remove last remaining usage of DB facade 2015-06-09 02:40:02 +02:00
Maksim Knyshov
b155a01b5f Remove unneeded .gitkeep's 2015-03-31 22:38:15 +03:00
Toby Zerner
2733b5810d 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
e78826953a Implement discussion composition and creation 2015-02-06 14:07:15 +10:30
Toby Zerner
effa414a01 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
f2ac56cb9c Improve auth API tests 2015-01-23 15:24:38 +10:30
Toby Zerner
215bdb672a Implement token-based auth API 2015-01-22 14:44:33 +10:30
Allineer
bcfda529ab [proposal] cameCase in the test names
Sorry :)
2015-01-22 01:42:47 +03:00
Toby Zerner
106c51071b Improve discussions API tests 2015-01-21 12:23:10 +10:30
Toby Zerner
0ad1b9784f Integration tests for DiscussionRepository
Also add some TestDummy factories (needs more work)
2015-01-21 12:22:20 +10:30
Toby Zerner
ad95c92c06 Update todo list, add screenshot 2015-01-20 15:07:38 +10:30
Toby Zerner
237591690c Begin testing API (see #3) 2015-01-19 20:46:14 +10:30
Mike Dugan
2d1e999dd9 add codeception, update gitignore 2014-12-22 08:28:01 -05:00
Toby Zerner
b5a246865d Hello world! 2014-12-20 16:56:46 +10:30