1
0
mirror of https://github.com/flarum/core.git synced 2025-07-24 18:21:33 +02:00
Commit Graph

94 Commits

Author SHA1 Message Date
Franz Liedke
53cc505037 Integration tests: Configure vendor path
Now that this is possible, make the easy change...
2019-06-13 00:13:57 +02:00
Franz Liedke
a7259bbd5f Integration tests: Memoize request handler as well
This is useful to send HTTP requests (or their PSR-7 equivalents)
through the entire application's middleware stack (instead of
talking to specific controllers, which should be considered
implementation detail).
2019-06-13 00:13:57 +02:00
Franz Liedke
5632ffb62b Integration tests: Fix test setup 2019-06-13 00:13:38 +02:00
Franz Liedke
a5847f5416 Apply fixes from StyleCI (#1756)
[ci skip] [skip ci]
2019-03-07 00:22:15 +01:00
Franz Liedke
402fd94892 Add regression test for #1738
This should ensure we can always search for search terms that appear
either only in the subject or only in the text of discussions.
2019-03-07 00:21:43 +01:00
Franz Liedke
b0d948dc32 Add helpful (?) output to test setup script 2019-02-03 20:39:33 +01:00
Franz Liedke
7870bf9149 Setup Composer commands for testing and setup 2019-02-03 20:39:33 +01:00
Franz Liedke
31266d3029 Make integration tests independent
This creates a dedicated test suite for integration tests. All of them
can be run independently, and there is no order dependency - previously,
all integration tests needed the installer test to run first, and they
would fail if installation failed.

Now, the developer will have to set up a Flarum database to be used by
these tests. A setup script to make this simple will be added in the
next commit.

Small tradeoff: the installer is NOT tested in our test suite anymore,
only implicitly through the setup script. If we decide that this is a
problem, we can still set up separate, dedicated installer tests which
should probably test the web installer.
2019-02-03 20:39:32 +01:00
Franz Liedke
e835b537f1 Move integration tests to separate directory
Again, we do all of this to prepare for creating "real" test suites for
each type of tests.
2019-02-01 19:01:12 +01:00
Franz Liedke
03c854b902 Extract pure unit tests so that they can run fast
- Move to separate directory (base for a separate test suite)
- Inherit directly from PhpUnit
- Configure test suite with dedicated XML file
2019-02-01 19:01:09 +01:00
Franz Liedke
d27a9a6421 DatabaseConfig: Implement Arrayable contract 2019-02-01 13:00:07 +01:00
Franz Liedke
4baf5d5008 Fix tests 2019-02-01 10:33:21 +01:00
Franz Liedke
f0a243cc37 Move default settings to install step
The various installation "frontends" (such as GUI and console) can now
provide custom overrides, if they want to.
2019-01-31 21:52:06 +01:00
Franz Liedke
3314a84b4e Fix the test setup and installer tests
We are still testing the installation logic, but not testing the
actual CLI task. I would love to do that, but IMO we first need to
find a way to do this fully from the outside, by invoking and
talking to the installer through the shell.

Because acceptance tests are easier to do when fully decoupled from
the application. (After all, they are intended to save us from
breaking things when changing code; and we cannot prove that when
we change the tests at the same time.)

It might be easier to start with acceptance tests for the web
installer, though.
2019-01-31 21:52:05 +01:00
Daniël Klabbers
f0d626aaa7 Increasing test coverage (#1711)
* added a few more tests, renamed singular to plural to match controller

* increase error reporting

* removed debugging and wait for tests
2019-01-01 21:02:18 +01:00
Franz Liedke
fad8ed335d Add regression test for email crawling vulnerability
Refs #1628.
2018-11-09 12:02:26 +01:00
Franz Liedke
99f9ec45f1 Move trait to base test class
This way, its properties can be overwritten in subclasses of
`ApiControllerTestCase`. This isn't allowed when those subclasses
use the trait directly.
2018-11-09 12:02:21 +01:00
Daniël Klabbers
33b39137b9 [b8] master token fix (#1622)
* fixed not being able to use master token because id column no longer holds key
* added flexibility of user_id column
* added tests to confirm the api keys actually work as intended
2018-11-07 22:34:09 +01:00
Daniël Klabbers
b64cdb1cfe fixes author gambit when used with fulltext search, added test to cover (#1620)
* fixes author gambit when used with fulltext search, added test to cover

* Apply fixes from StyleCI

[ci skip] [skip ci]
2018-10-29 23:01:25 +01:00
Franz Liedke
194808ec7c Fix tests 2018-10-24 22:38:47 +02:00
Franz Liedke
9fabcff497 Fix tests 2018-09-22 00:40:19 +02:00
Toby Zerner
bd0b2a2f1d Fix tests 2018-09-21 14:32:41 +09:30
Franz Liedke
aae8aa4a51 Travis: Add table prefix to build matrix (#1568)
Fixes #1564.
2018-09-16 20:59:40 +02:00
Toby Zerner
0d526cfc37 Rename user.isActivated 2018-08-24 22:13:05 +09:30
Toby Zerner
14885fc0e1 Rename discussion.startPost 2018-08-24 22:13:05 +09:30
Toby Zerner
f2f9c3c21c Merge branch 'master' into 1236-database-changes 2018-08-24 21:07:00 +09:30
Franz Liedke
eb0e50a305 Fix tests after sites refactoring 2018-08-22 07:58:50 +02:00
Franz Liedke
e65b3ac153 Split SessionServiceProvider from UserServiceProvider
This lets us register the former during installation, where the
latter is not yet registered.

That, in turn, means we can finally re-enable the StartSession
middleware in the installer app, which we need to log in the new
admin user when installation is complete.
2018-08-22 07:58:50 +02:00
Daniel Klabbers
8829da2765 Merge branch 'master' into 1236-database-changes 2018-06-19 09:57:47 +02:00
Sajjad Hashemian
818885729d rename TokenController to CreateTokenController 2018-06-06 09:40:29 +04:30
Daniël Klabbers
9d46446a8f Merge branch 'master' into 1236-database-changes 2018-06-03 21:51:01 +02:00
Franz Liedke
837bc05840 Replace ControllerInterface with PSR-15 interface
The custom interface already had the same signature as the
one from the standard (except for the return type hint), so
why not use that one now? :)
2018-05-30 09:49:47 +02:00
Daniël Klabbers
75f237b674 [wip] 1211 mariadb compatibility (#1440)
fixes #1211 

As we've already upgraded our minimum requirement to 7.1 there's no current need to force a constraint on dbal 2.7+.
2018-05-29 05:51:22 +02:00
Daniel Klabbers
6619fb0848 merged api tests into branch 2018-05-16 09:27:01 +02:00
Daniël Klabbers
ead24fbcb8 additional tests for api controllers (#1433)
* added CreatePostControllerTest

* added DeleteDiscussionControllerTest

* added ListDiscussionControllerTest

* added TokenControllerTest

* minor improvement to policy, no need for Carbon object there, added ShowDiscussionControllerTest

* added showDiscussionControllerTest but cant make Guests view the discussion created by a user

* viewing for guests tested, we might need factories
2018-05-16 09:25:48 +02:00
Daniel Klabbers
44f8cef62a Merge branch 'master' into 1236-database-changes 2018-05-14 13:32:48 +02:00
Daniël Klabbers
3f429fb08c adds a few additional api controller tests (#1429)
* added CreatePostControllerTest

* added DeleteDiscussionControllerTest

* added ListDiscussionControllerTest

* Apply fixes from StyleCI

[ci skip] [skip ci]
2018-05-14 13:32:19 +02:00
Daniel Klabbers
80cc03e4f1 fixed several column changes found by tests 2018-05-14 11:34:24 +02:00
Daniel Klabbers
19645785a3 merged master 2018-05-14 09:23:06 +02:00
Daniël Klabbers
77bb82bda4 Improved foundational backend unit tests (#1405)
* part one of adding tests, updating core

* Apply fixes from StyleCI

[ci skip] [skip ci]

* we need xdebug for code coverage, and hhvm was already removed

* forgot about the sidecar for mysql completely 🤦

* gitignore removed this installed json we need to fake that we have extensions

* using reguarded closure
2018-04-17 11:15:28 +02:00
Daniel Klabbers
c7f1529333 we can move this file deeper into storage 2018-04-13 09:12:56 +02:00
luceos
024e074b83 Apply fixes from StyleCI
[ci skip] [skip ci]
2018-04-13 07:07:02 +00:00
Daniel Klabbers
8ae6e0c766 added the create discussion test, also renamed some classes that seem to have been incorrectly renamed from the other testing branch 2018-04-13 09:06:42 +02:00
Daniel Klabbers
9438534232 adds api controller tests 2018-04-13 07:52:39 +02:00
Daniel Klabbers
aedccdd381 gitignore removed this installed json we need to fake that we have extensions 2018-04-13 07:34:04 +02:00
luceos
251e6d8cdd Apply fixes from StyleCI
[ci skip] [skip ci]
2018-04-13 05:13:32 +00:00
Daniel Klabbers
42d22f7c06 part one of adding tests, updating core 2018-04-13 07:13:10 +02:00
Franz Liedke
84be6f3f7f Fix test namespace 2018-03-04 00:04:43 +01:00
Franz Liedke
b75f098de7 Change namespace of test classes
(as implemented by @luceos in his WIP PR)
2018-03-04 00:01:49 +01:00
Toby Zerner
cc1239fe9f Update test namespaces 2018-01-11 01:25:10 +10:30