- Apr 04, 2024
-
-
Stefan Bürk authored
To harden the Extbase LazyLoadingProxy implementation a new test has been added with #101400, which creates a proxy directly and using ObjectAccess::getProperty() to access a property of the not loadable child proxy class instance. Due to the use of magic methods`__get()` and `__isset()` methods in the `LazyLoadingProxy` class and some wrong assumptions of the Symfony PropertyAccessor simply null has been retrieved even if the concrete class could not been retrieved (property on a null value instead of an object). The property accessor is used under the hood within the Extbase internal ObjectAccess implementation. The Symfony Team recently declared that behaviour a bug and fixed it with releases `7.0.6` and `6.4.6` and now correctly throwing the `PropertyNotAccessibleException`. Failing nightlies with Symfony releases containing the bugfix revealed a incorrect test implementation, using a constructed and unrealistic construct. This change modifies the test to use a correct access on the LazyLoadingProxy without changing the scenario of the test. [1] https://github.com/symfony/symfony/releases/tag/v7.0.6 [2] https://github.com/symfony/symfony/releases/tag/v6.4.6 [3] https://github.com/symfony/symfony/pull/54194 Resolves: #103531 Related: #101400 Releases: main, 12.4 Change-Id: I5bdd52955af138c1e99b4492c9b5a43839c743cf Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83645 Reviewed-by:
Anja Leichsenring <aleichsenring@ab-softlab.de> Tested-by:
Oliver Klee <typo3-coding@oliverklee.de> Tested-by:
core-ci <typo3@b13.com> Tested-by:
Anja Leichsenring <aleichsenring@ab-softlab.de> Reviewed-by:
Torben Hansen <derhansen@gmail.com> Reviewed-by:
Oliver Klee <typo3-coding@oliverklee.de> Reviewed-by:
Stefan Bürk <stefan@buerk.tech> Tested-by:
Torben Hansen <derhansen@gmail.com> Tested-by:
Stefan Bürk <stefan@buerk.tech>
-
- Feb 25, 2024
-
-
Christian Kuhn authored
phpunit 11 deprecates annotations like `@test` and `@dataProvider` in favor of their attribute counterparts. We'll adapt core main & v12 to keep v12 backports simple. The patch takes care of Tests/Functional and Tests/FunctionalDeprecated. Script `Build/Scripts/splitFunctionalTests.php` is adapted to deal with annotations for CI to continue splitting functional tests into chunks. This also fixes detection in two test cases that had unexpected `@test` annotation combinations which were not properly detected before. > composer req --dev rector/rector > wget https://forge.typo3.org/attachments/download/38273/rector.php > find typo3/ -name \*Test.php | grep Tests/Functional | xargs bin/rector process > rm rector.php > composer rem --dev rector/rector Minor manual adaption in a few files plus cgl fixes. Also deny `@test` annotion in annotationChecker.php now to not introduce new occurences with other patches anymore. The script will receive another cleanup to look at further obsolete annotations. `@dataProvider` is currently still used in acceptance tests. Change-Id: I42705b57193a32db6fe17276d53476ecddcae835 Resolves: #103195 Related: #103180 Releases: main, 12.4 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83115 Reviewed-by:
Anja Leichsenring <aleichsenring@ab-softlab.de> Tested-by:
core-ci <typo3@b13.com> Tested-by:
Stefan Bürk <stefan@buerk.tech> Tested-by:
Anja Leichsenring <aleichsenring@ab-softlab.de> Tested-by:
Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by:
Stefan Bürk <stefan@buerk.tech> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch>
-
- Aug 02, 2023
-
-
Christian Kuhn authored
Extension blog_example is used in various extbase tests. It defines invalid relations from tags table over MM to post and persons. The patch fixes the TCA - those relations now work in BE as well, when the fixture blog_example is activated. Essentially all functional tests that works with this extension break with the fixed TCA now. The major part of the patch is to disentangle the .csv import and export files to make them independent from each other per test-case, and to fix the imported and asserted db state along the way. Resolves: #101528 Releases: main, 12.4 Change-Id: I4fb7d6ac82962f8ef7b630b261d543f4ff626bde Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80283 Tested-by:
Oliver Klee <typo3-coding@oliverklee.de> Reviewed-by:
Anja Leichsenring <aleichsenring@ab-softlab.de> Tested-by:
core-ci <typo3@b13.com> Reviewed-by:
Andreas Fernandez <a.fernandez@scripting-base.de> Tested-by:
Anja Leichsenring <aleichsenring@ab-softlab.de> Tested-by:
Andreas Fernandez <a.fernandez@scripting-base.de> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch> Tested-by:
Christian Kuhn <lolli@schwarzbu.ch>
-
- Jul 25, 2023
-
-
Torben Hansen authored
When a domain model object has a lazy loading property (e.g. relation to another domain model object), the `AbstractGenericObjectValidator` may fail validation the domain model, if the database record for the related object has been deleted. This change fixes the problem by adding a null safe operator to the `$realInstance` variable in the magic `__get` call in LazyLoadingProxy. The return type for `_loadRealInstance` has been adapted, since the function actually can return `null`. This allows the removal of an entry in the phpstan baseline file. Additionally a todo in `AbstractGenericObjectValidator` has been removed, since the function actually supports lazy loading proxies as the initial error shows. Resolves: #101400 Releases: main, 12.4 Signed-off-by:
Torben Hansen <derhansen@gmail.com> Change-Id: Ib39da09fdc94ef529f672af7f948d6a7fd82e531 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80104 Tested-by:
Oliver Klee <typo3-coding@oliverklee.de> Reviewed-by:
Oliver Klee <typo3-coding@oliverklee.de> Tested-by:
Alexander Schnitzler <git@alexanderschnitzler.de> Reviewed-by:
Nikita Hovratov <nikita.h@live.de> Tested-by:
core-ci <typo3@b13.com> Reviewed-by:
Alexander Schnitzler <git@alexanderschnitzler.de> Tested-by:
Nikita Hovratov <nikita.h@live.de>
-
- Apr 28, 2023
-
-
Anja Leichsenring authored
In preparation of composer based test setups, all fixture extensions require fully functional `composer.json` files. For starters, the minimal required `composer.json` is added. We will adjust as we go. Extensions without classes don't receive PSR-4 class loading definitions as those are not needed. As a convention, all fixture extensions have their composer name use the vendor `typo3tests`. Classes will have the vendor `TYPO3Tests`. This way, fixture extensions are easy to identify, both by providing tests that use the extensions, as well as in development to not accidentally use such an extension or class. Resolves: #100773 Releases: main Change-Id: Ibc1788031e39113dc1efda4ca7e4400e9cda444d Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/78886 Tested-by:
core-ci <typo3@b13.com> Reviewed-by:
Oliver Klee <typo3-coding@oliverklee.de> Reviewed-by:
Stefan Bürk <stefan@buerk.tech> Reviewed-by:
Jörg Bösche <typo3@joergboesche.de> Tested-by:
Oliver Klee <typo3-coding@oliverklee.de> Tested-by:
Stefan Bürk <stefan@buerk.tech>
-
- Apr 11, 2023
-
-
Wouter Wolters authored
Test classes should never extend each other. phpunit 10 is also a bit more picky about naming of abstract test cases. The patch adds a script to verify all test case files are declared final, adds it to CI, and adapts existing tests accordingly. > Build/Scripts/runTests.sh -s checkTestClassFinal Change-Id: I07581bffebe42a82fafc56a9bc6cae7c46508b1a Resolves: #100544 Releases: main Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/78460 Tested-by:
core-ci <typo3@b13.com> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch> Tested-by:
Christian Kuhn <lolli@schwarzbu.ch> Tested-by:
Benni Mack <benni@typo3.org> Reviewed-by:
Benni Mack <benni@typo3.org>
-
- Nov 08, 2022
-
-
Alexander Schnitzler authored
Due to the dependency of those objects to the DataMapper and its own dependency chain, serialization of those objects lead to error: Serialization of \Closure not allowed. To ommit this issue and to reduce the footprint of the serialization data in general, the data mapper should be omitted and reinitialized via __serialize() and __unserialize() Releases: main, 11.5 Resolves: #97190 Resolves: #92148 Change-Id: If8b78a93308eb14d40080c9cceee95754b785ba8 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73975 Tested-by:
Christian Kuhn <lolli@schwarzbu.ch> Tested-by:
core-ci <typo3@b13.com> Tested-by:
Benni Mack <benni@typo3.org> Tested-by:
Stefan Bürk <stefan@buerk.tech> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by:
Oliver Klee <typo3-coding@oliverklee.de> Reviewed-by:
Benni Mack <benni@typo3.org> Reviewed-by:
Stefan Bürk <stefan@buerk.tech>
-