mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-11-24 04:36:13 +01:00
Commit graph

142 commits

Author SHA1 Message Date
Eike Starkmann
d27d785417
Merge 951aaf0751 into de096dac50 2024-11-12 21:22:44 +01:00
Oliver Klee
8a7bd78df1
[DOCS] Add comment for controller unit tests (#1502)
Explain that those tests are not best practice anymore, and that we're
in the process of migrating them to functional tests.

Fixes #1499
2024-10-29 16:54:53 +01:00
Oliver Klee
9446d14b77
[TASK] Move a repository test from unit to functional (#1484)
Unit tests for repositories are quite a hassle as we then need to
set up all dependencies in `setUp()` ourselves.

So convert the test to a functional tests where we can rely on the
container to create and initialize the subject for us.
2024-10-06 20:50:24 +02:00
Eike Starkmann
951aaf0751 [BUGFIX] Fix code style
Related: #1228
2024-07-31 19:55:03 +02:00
Eike Starkmann
8ac92402eb [BUGFIX] Use single quotes
Related: #1228
2024-07-31 19:39:14 +02:00
Eike Starkmann
d7dd9465a3 [TASK] Add for showAction
Related: #1228
2024-07-31 19:39:14 +02:00
Oliver Klee
b2d2f2a705
[TASK] Ensure a type in a test (#1268) 2024-05-06 11:18:22 +00:00
Oliver Klee
248c759206
[TASK][!!!] Require a storage PID for the tea list (#1223)
Fixes #1024
Supersedes #1024
2024-04-15 11:13:57 +02:00
Oliver Klee
a014ea7efb
[BUGFIX] Load realistic, full TypoScript in the controller tests (#1224)
To be closer to a real-world scenario, we also should load the constants
of fluid_styled_content and the constants and setup of our own
extension.
2024-04-15 09:24:22 +02:00
Oliver Klee
188ca41922
[TASK] Reduce the DB fixtures some more (#1226)
Do not provide the PID where the PID is not relevant to the test.

This allows the reader to see more easily what is relevant for the
test.

Also reduce unnecessary quoting of integers in the DB fixtures.
2024-04-15 07:57:18 +02:00
Oliver Klee
e9019ddae8
[TASK] Test that TeaRepository.findByOwnerUid ignores the storage PID (#1227) 2024-04-15 07:21:27 +02:00
Oliver Klee
781c6f6521
[TASK] Separate the fixture TypoScript into setup and constants (#1225)
To prepare for more extended functional controller tests, we now
have a dedicated folder for fixture TypoScript setup, allowing us to have
a clear separation between setup and constants.
2024-04-15 07:19:53 +02:00
Oliver Klee
d65598e8fa
[TASK] Use unique and more realistic test data in the unit tests (#1206)
Fixes #1204
2024-04-02 07:19:31 +02:00
Oliver Klee
532c30a1ff
[TASK] Consistently quote string values in fixture CSV files (#1137) 2024-01-24 13:21:58 +01:00
Oliver Klee
94a494240e
[TASK] Prefer string casts over explictly calling __toString (#1136) 2024-01-24 13:21:49 +01:00
Oliver Klee
fe79124c0e
[TASK] Rework a test communicate its purpose more clearly (#1133)
When the ordering of items (by title) is verified, checking the
title instead of the UID makes this more clear.

Fixes #1132
2024-01-24 07:38:51 +01:00
Oliver Klee
2ab2a6c0aa
[TASK] Avoid unnecessary FQCN (#1135) 2024-01-23 20:39:13 +01:00
Oliver Klee
eeda862e77
[!!!][TASK] Drop additional namespace segment for the Tea model (#1025)
The `Product` namespace segment in the domain model namespace
`TTN\Tea\Domain\Model` currently serves no purpose and only adds
confusion. So let's simplify the extension structure accordingly.

(I intended to use this to demonstrate DDD contexts, but never
built enough models in the Tea extension for this to actually
make sense.)

Fixes #1008
2024-01-16 15:21:21 +01:00
Oliver Klee
4335df7305
[TASK] Migrate the deprecated executeFrontendRequest in tests (#1116)
This method is deprecated. Starting with TYPO3 11LTS,
`executeFrontendSubRequest` should be used.

Co-authored-by: Daniel Siepmann <coding@daniel-siepmann.de>
2024-01-15 13:43:38 +01:00
Oliver Klee
7fe2758291
[TASK] Move the PHPUnit configuration files to Configuration/ (#1108)
The `Tests/` directory should only include test code, but not the
configuration files.

Fixes #1082
2024-01-08 00:41:08 +01:00
Oliver Klee
0ff0f83edd
[TASK] Add coverage configuration for functional tests (#1092)
We already had this for unit tests, but it was missing for
functional tests.

Also, we do not need to provide a path in this configuration - it
suffices to have this node present in the configuration files.

Closes #1078
2024-01-02 22:34:49 +01:00
Oliver Klee
8e3cc5b6a1
[CLEANUP] Sort the PHPUnit configuration options (#1091) 2023-12-19 12:29:19 +01:00
Oliver Klee
2c972eb11a
[CLEANUP] Autoformat the PHPUnit configuration files (#1084)
This avoids unrelated formatting changes in functional changes.
2023-12-19 12:17:04 +01:00
555c43e18b
[FEATURE] Add first functional test using a request (#1021)
That way the extension serves as an example on how to use the TYPO3
internal requests provided by the TYPO3 testing framework.
Those can be used as integration tests.
They are also often easier to set up on existing projects and allow to
refactor the code base, compared to functional and unit tests.

Resolves: #859
2023-11-27 14:18:04 +01:00
58971754c4
[TASK] Add missing test case for fetching none existing tea (#1017)
Dedicated test cases were added in the past.
This test case was not added yet.

Resolves: #858
2023-11-27 12:36:42 +00:00
d56d58ed04
[CLEANUP] Migrate typo3conf path to composer package name (#1012)
The tests now respect the TYPO3 extension key as well as the composer
package name.
There is no more need to use the old (no longer used) typo3conf/ext
path.

Resolves: #739
2023-11-27 12:10:13 +01:00
Oliver Klee
d9718fd054
[TASK] Split up the DB fixtures for the functional tests (#993)
This makes the fixture more minimal and reduces cross-dependencies
between tests.

Also consistently avoid quotes for integer data in CSV DB fixtures.

Fixes #988
2023-11-19 22:36:32 +01:00
Oliver Klee
d15bd079d6
[TASK] Migrate DB queries to CSV assertions in the functional tests (#998)
This makes the corresponding test a lot more concise and easier to
read.
2023-11-19 22:34:02 +01:00
Oliver Klee
450905287c
[CLEANUP] Use more stubs instead of mocks (#995)
This makes the purpose of the test doubles more clear to the reader.

Fixes #986
2023-11-18 06:48:56 +01:00
Oliver Klee
3cdf8df7a0
[CLEANUP] Inline some variables in the tests (#997)
This makes the tests more concise while still keeping them readable.
2023-11-18 06:44:40 +01:00
Oliver Klee
fddd50da3e
[CLEANUP] Convert one more mock to a stub (#977)
This makes the purpose of the mock/stub more explicit.
2023-11-05 22:46:37 +01:00
Oliver Klee
286aa05073
[TASK] Use more stubs in the unit tests (#962)
This way, the purpose of the stub/mock is more explicit.

Fixes #870
2023-11-01 21:15:42 +01:00
Oliver Klee
350fe8abb2
[CLEANUP] Simplify the mock building in the unit tests (#963) 2023-11-01 19:59:07 +00:00
Oliver Klee
a444e2266c
[CLEANUP] Make the TYPO3 version switches more consistent (#964)
Also reduce the cognitive load as these switches are between
V12 and pre-V12.
2023-11-01 19:56:10 +00:00
Oliver Klee
3d92e0cc98
[CLEANUP] Use power of the DI container in the functional tests (#961) 2023-11-01 20:24:26 +01:00
Łukasz Uznański
bc64aedb38
[TASK] Use own configuration files for tests (#952)
Resolves: #902
2023-10-25 19:08:36 +02:00
Oliver Klee
b4c93d8dea
[TASK] Switch the TeaController to construtor injection (#881)
Fixes #869
2023-07-03 14:26:21 +02:00
Oliver Klee
cda38af84b
[FEATURE] Add a delete functionality for the Tea FE editor (#876)
The delete action is triggered using a form with a submit button,
causing a POST request to be sent instead of a GET request.
This is because GET requests should not modify (or delete) data,
but only read it and be idempotent. Also, the request then
is guaranteed to not get cached.

From a usability perspective, a button instead of a link also
is semantically more correct: A link is expected to bring you
to some place, whereas a button is expected to trigger some
action.

Closes #871
2023-06-23 11:55:19 +02:00
Oliver Klee
82e7e95487
[FEATURE] Allow creating a new tea in the FE (#874)
Part of #871
2023-06-22 20:30:12 +02:00
Oliver Klee
ad460b20b3
[FEATURE] Add FE editing for existing tea records (#872)
Part of #871
2023-06-22 14:20:14 +02:00
Oliver Klee
1f263d8839
[FEATURE] Add a list view for the FE tea editor (#864)
This is one more part of building CRUD functionality.
2023-06-22 11:17:51 +00:00
Oliver Klee
8fe9307b37
[BUGFIX] Allow ActionController::redirect in tests again (#865)
In TYPO3 12LTS, this method still exists. So we are still able
to mock it.
2023-06-22 11:49:12 +02:00
Oliver Klee
bbe469169b
[FEATURE] Add Tea.ownerUid (#860)
This is a pre-patch for adding a CRUD plugin for tea records.

This property contains only the UID of the owner FE user, but not
a relation to a FE user model. This is because we neither have nor
need a FE user model for the purposes of the CRUD plugin.
2023-06-21 09:16:13 +02:00
Oliver Klee
2ab50201fa
[TASK] Make the controller tests more fine-grained (#856)
Tests should only test one thing (if possible).
2023-06-20 07:19:57 +00:00
Oliver Klee
77057e06a8
[TASK] Make the repository tests more fine-grained (#855)
Tests should only test one thing (if possible).
2023-06-20 09:10:31 +02:00
68372cc850
[TASK] Make all test cases final (#801)
Resolves: #797
2023-04-06 14:34:15 +00:00
4d2bbced74
[BUGFIX] Do not mock unavailable methods (#799) 2023-04-06 14:32:05 +02:00
Łukasz Uznański
7cd09a3b52
Upgrade to TYPO3 v12.2 (#746) 2023-02-08 17:26:08 +01:00
Oliver Klee
a6c4a86273
[BUGFIX] Get the functional tests to work with TYPO3 >= 12.1 (#704)
Starting with TYPO3 12.1, a request is required for the
`BackendConfigurationManager` to not crash:
https://review.typo3.org/c/Packages/TYPO3.CMS/+/76447

Also, a fix in that area has been merged (after the release of TYPO3 12.1)
that might allow us to remove our workaround again once we've updated to
TYPO3 12.2 or 12.1.3:
https://review.typo3.org/c/Packages/TYPO3.CMS/+/77028
2022-12-22 09:47:55 +01:00
Oliver Klee
14b8628483
[TASK] Stop using Prophecy (#676)
The Prophecy project is basically dead, and our Prophecy dependency
currently prevents installations on PHP 8.2 without having to resort
to fiddling with Composer's platform options.
2022-11-05 17:08:32 +01:00