mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-11-23 05:16:12 +01:00
Commit graph

122 commits

Author SHA1 Message Date
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
Oliver Klee
6b957de595
[FEATURE] Allow installations on TYPO3 12 (#652) 2022-10-19 09:06:36 +02:00
Oliver Klee
1e157e6958
[TASK] Upgrade to the testing framework V7 (#629)
* [TASK] Upgrade to the testing framework V7

This is required to also run the tests on TYPO3 12LTS.

* Update CHANGELOG.md

Co-authored-by: Lina Wolf <48202465+linawolf@users.noreply.github.com>
Co-authored-by: Chris Müller <2566282+brotkrueml@users.noreply.github.com>
2022-10-13 13:52:25 +02:00
Oliver Klee
b3f0eb3f3d
[CLEANUP] Use more native property types in the tests (#628) 2022-10-10 16:05:06 +02:00
Oliver Klee
0a1a00dd22
[CLEANUP] Drop usages of ObjectManager whereever possible (#616)
Fixes #596
2022-10-10 02:15:33 +02:00
Oliver Klee
f6af430180
[TASK] Upgrade to PHPUnit 9 (#610)
Also upgrade PHPCOV to match the used PHPUnit version

Fixes #586
Fixes #542
2022-10-09 06:19:32 +02:00
Oliver Klee
bb7e6d2670
[CLEANUP] Add more native type annotations in the tests (#612) 2022-10-06 17:51:41 +02:00
Oliver Klee
4537d5fca9
[CLEANUP] Drop some redundant PHPDoc type annotations (#611) 2022-10-06 17:51:04 +02:00
Lina Wolf
8be6d02315
[TASK] Convert functional test fixtures to CSV (#601)
Fixes #600

Co-authored-by: lina.wolf <lwolf@w-commerce.de>
2022-10-03 19:10:08 +02:00
Lina Wolf
e469041db7
[CLEANUP] Use typed properties instead of @var annotations (#599)
The `@var` annotations where left where it is not possible yet to replace them in PHP 7.4.

Fixes #550

Co-authored-by: lina.wolf <lwolf@w-commerce.de>
2022-10-03 19:00:55 +02:00
Lina Wolf
5d3fcee00e
[TASK] Return ResponseInterface in controller actions (#597)
Co-authored-by: lina.wolf <lwolf@w-commerce.de>
2022-10-03 16:02:32 +02:00
Oliver Klee
e360b1ea5a
[TASK] Also mock redirectToUri in the controller unit test (#554)
Now all methods that conceptually should not be part of a controller
(and that hence must never be executed in a unit test)
are mocked for consistency.

Also sort the method names.

Fixes #446
2022-09-06 15:26:47 +02:00
Oliver Klee
be838adde5
[TASK] Remove the ancient acceptance tests (#512)
The acceptance tests have not been testing the extension itself,
have not been maintained for quite some time, and do not serve
as a good example anymore.

Until we have a proper set of example acceptance tests, we should
remove them.

Also drop the now-unused dependency on Codeception.
2022-08-28 09:33:50 +02:00
Oliver Klee
dc6c0eedeb
[TASK] Change misleading variable names in some tests (#470)
We are not using any "container" class here, and hence the results from
repository find methods should be named `$result` instead of `$container`.
2022-06-28 23:52:02 +02:00
Oliver Klee
569fad3626
[CLEANUP] Remove type annotations for fields from the testing framework (#453)
As in these cases the type annotations from the base class are used,
we can avoid PHPStan warnings about discrepancies between our annotations
and the annotations from the testing framework for the corresponding
fields in the superclass.
2022-06-01 15:26:47 +02:00
Oliver Klee
71a08a1c20
[BUGFIX] Mark the repository test as also covering the model (#436)
We currently can only test the lazy loading of the model image
with a functional test that retrieves a model from the database
via the repository.

So the functional test for the repository also needs to be marked as
covering the model class to make our code coverage correct.
2022-04-29 14:54:41 +02:00
Oliver Klee
f1a0fbef04
[CLEANUP] Use prepared statements for SQL queries in the tests (#443)
Also add another type check to help with debugging failed queries.
2022-04-29 14:27:47 +02:00
Oliver Klee
62e8c21596
[CLEANUP] Make a type annotation in a unit test more specific (#435)
This helps static code analysis.
2022-04-20 15:05:45 +02:00
Mathias Bolt Lesniak
3ca00b78e4
[BUGFIX] Use executeQuery() in functional test example (#422)
This avoids potential false results in the tests because it doesn't add additional restrictions for starttime, endtime, deleted, and hidden.

Fixes #421
2022-04-11 14:15:43 +02:00
Oliver Klee
345e01e381
[CLEANUP] Drop an unnecessary field in a test (#413) 2022-04-03 02:25:42 +02:00
Oliver Klee
869f348ce8
[CLEANUP] Make a type annotation more specific (#415) 2022-03-30 12:14:04 +02:00