1
0
mirror of https://github.com/flarum/core.git synced 2025-08-05 16:07:34 +02:00
Commit Graph

431 Commits

Author SHA1 Message Date
Franz Liedke
fe0159ecd1 Test setup: Do not use env() helper
Not needed, and not working without a full Laravel installation.
2021-01-13 01:21:38 -05:00
Franz Liedke
f45a1608df Split up Application and Container
- Stop trying to implement Laravel's Application contract, which
  has no value for us.
- Stop inheriting from the Container, injecting one works equally
  well and does not clutter up the interfaces.
- Inject the Paths collection instead of unwrapping it again, for
  better encapsulation.

This brings us one step closer toward upgrading our Laravel
components (#2055), because we no longer need to adopt the changes
to the Application contract.
2021-01-13 01:21:38 -05:00
Alexander Skvortsov
915a428973 Add console extender (#2057)
* Made the console command system extender-friendly

* Added console extender

* Added ConsoleTestCase to integration tests

* Added integration tests for console extender

* Marked event-based console extension system as deprecated

* Moved trimming command output of whitespace into superclass

* Renamed 'add' to 'command'

* Added special processing for laravel commands

* Code style fixes

* More style fixes

* Fixed $this->container
2021-01-13 01:21:38 -05:00
Franz Liedke
21f4c3f6dd Apply fixes from StyleCI
[ci skip] [skip ci]
2021-01-13 01:21:38 -05:00
Franz Liedke
30450687b9 Replace authenticatedRequest() by request() option
I feel this makes the parameters a bit more clear, does not rely on
inheritance (you can only inherit from one class, but we might want more
of these helpers in the future), and has less side effects (e.g. no
creation and, more importantly, deletion of users in the database).

Refs #2052.
2021-01-13 01:21:38 -05:00
Franz Liedke
0c4ab20b50 Tests: Extract trait for building requests 2021-01-13 01:21:38 -05:00
Alexander Skvortsov
232a431b50 Add Authenticated Test Case utility 2021-01-13 01:21:38 -05:00
Franz Liedke
b0711b18c7 Integration tests: Allow registering extenders 2021-01-13 01:21:38 -05:00
Franz Liedke
23ad5bcc6b Integration tests: Add lazy server helper
This allows sending requests directly in an integration test, without
having *explicitly* booted the app.
2021-01-13 01:21:38 -05:00
Franz Liedke
1ca610d96a Integration tests: Create app lazily when needed
This will allow registering extenders in test scenarios. Previously,
this would not have had any effect as the app would have booted already.
2021-01-13 01:21:38 -05:00
Matt Kilgore
924a2e5efa Change Zend namespace to Laminas (#1963)
Also ensure backwards compatibility for extensions that use the Zend framework but don't explicitly require it.
2021-01-13 01:21:38 -05:00
Franz Liedke
48d996d948 Apply fixes from StyleCI
[ci skip] [skip ci]
2021-01-13 01:21:38 -05:00
Franz Liedke
c869417759 Automatically set up Mockery for unit tests
- Use provided PhpUnit listener to enforce verification of expectations.
- Include Mockery's trait to auto-close Mockery after each test.
2021-01-13 01:21:38 -05:00
Stefan Totev
3decf1b658 Normalize Base URL during installation
- Fix base url when is appended with a script filename
- Add default base url http://flarum.local when CLI wizard used
- Remove some code duplication
- Add minor improvement to the UX when CLI wizard used
- Add tests
- Extract base url normalisation into its own value object
2021-01-13 01:21:38 -05:00
Daniël Klabbers
93d6b235e3 fixed tests on master, missing views directory and suppressing notices from tempnam when storing files in tmp 2021-01-13 01:21:38 -05:00
Daniël Klabbers
c772029af9 Apply fixes from StyleCI (#1800)
[ci skip] [skip ci]
2021-01-13 01:21:38 -05:00
Daniël Klabbers
f47d739aac Using a different setting key now, so that it won't break tests whenever you re-run them once smtp is set.
Fixed, badly, the test to create users etc caused by the prepareDatabase flushing all settings by default.
2021-01-13 01:21:38 -05:00
Daniël Klabbers
f686fd3e57 Fixed issue with tmp/storage/views not existing, this caused tmpname to notice.
Fixed csrf test that assumed an access token allows application access, which is actually api token.
Improved return type hinting in the StartSession middleware
2021-01-13 01:21:38 -05:00
Franz Liedke
c5d042929f Refactor tests to shorten HTTP requests
Multiple tests now provide JSON request bodies, and others copy cookies
from previous responses, so let's provide convenient helpers for these.
2021-01-13 01:21:38 -05:00
Franz Liedke
05b4d8076b Integration tests: Configure vendor path
Now that this is possible, make the easy change...
2021-01-13 01:21:38 -05:00
Franz Liedke
e6d4c66933 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).
2021-01-13 01:21:38 -05:00
Franz Liedke
e20961dabc Integration tests: Fix test setup 2021-01-13 01:21:38 -05:00
Franz Liedke
cc3d0d6d0a Add helpful (?) output to test setup script 2021-01-13 01:21:38 -05:00
Franz Liedke
d90b77073e Setup Composer commands for testing and setup 2021-01-13 01:21:38 -05:00
Toby Zerner
0b657c0b4c Restore Initial Meaningful Test Infrastructure
This testing package was initially a part of flarum/core, but was
extracted during the 0.1.0-beta.16 release cycle. The extraction was
made through git's filter-branch tool to preserve some useful history in
the repository.
2021-01-13 01:21:33 -05:00
Daniël Klabbers
24519534cc fix incorrect version compare for beta 14 to 15 2020-12-14 21:31:13 +01:00
Daniël Klabbers
a509feb080 changelog and constraint for beta 15 2020-12-14 21:03:48 +01:00
Daniël Klabbers
4dcc9036d7 npm audit fix 2020-12-14 21:01:47 +01:00
Daniël Klabbers
739386bf81 npm audit fix 2020-12-14 21:00:19 +01:00
Daniël Klabbers
ba1eb76845 changelog and constraint for beta 15 2020-12-14 20:49:51 +01:00
Alexander Skvortsov
787bbc0f33 Make listener methods static
This is needed since we're listening to the individual methods of the class, as opposed to registering the class as a subscriber.
2020-12-10 23:33:45 -05:00
Alexander Skvortsov
d2d7b3026e Update composer metadata for admin dashboard 2020-12-08 19:53:32 -05:00
Alexander Skvortsov
c1dc78d7c4 Update composer metadata for admin dashboard 2020-12-08 19:53:16 -05:00
Alexander Skvortsov
8b356d82d1 Apply fixes from StyleCI 2020-12-08 20:08:37 +00:00
Alexander Skvortsov
bd9553eb33 Refactor for new extenders 2020-12-08 15:08:18 -05:00
Sami Mazouz
bebced2d53 Use new extenders (#23) 2020-12-08 14:04:22 -05:00
Alexander Skvortsov
2bd22d12e2 Apply fixes from StyleCI 2020-12-08 18:37:38 +00:00
Alexander Skvortsov
d747946e49 Use proper Event and Service Provider extenders 2020-12-08 13:37:23 -05:00
flarum-bot
def0faa7c3 Bundled output for commit 69a90a200b [skip ci] 2020-11-25 06:10:21 +00:00
Alexander Skvortsov
69a90a200b Add composer metadata for admin ux revamp 2020-11-25 01:09:33 -05:00
Alexander Skvortsov
90120e7bde Update admin js for new admin UX 2020-11-25 01:08:43 -05:00
flarum-bot
6ce50a1c52 Bundled output for commit b11a6d52b4 [skip ci] 2020-11-25 06:04:15 +00:00
Alexander Skvortsov
b11a6d52b4 Update admin JS for new UX 2020-11-25 01:03:14 -05:00
Alexander Skvortsov
0113ea0118 Add AdminUX Metadata 2020-11-25 00:59:29 -05:00
Daniël Klabbers
4f0a41ba98 changelog for beta 14.1 2020-10-27 13:23:31 +01:00
Daniël Klabbers
e7a58e05c0 Replace leftover app()->url() with UrlGenerator 2020-10-24 21:35:31 +02:00
Robert Korulczyk
71cc7ae96d Move locale files from language pack to extension. 2020-10-24 18:20:26 +02:00
Daniël Klabbers
86da969449 changelog and dep for v0.1.0-beta.14 2020-10-14 16:50:51 +02:00
Daniël Klabbers
13a2b8d9ad changelog and dep for v0.1.0-beta.14 2020-10-14 13:03:37 +02:00
Daniël Klabbers
14e04e09a1 npm audit security vulnerabilities patched 2020-10-13 21:11:12 +02:00