74651[BUGFIX] Resolve a stray strpos call
Commit message
Review
-
Code review CR +2 Done
- Stefan Bürk +2
- Simon Schaufelberger +1
-
Verified V +2 Done
- Stefan Bürk +2
- Simon Schaufelberger +1
- core-ci +1 CI
Issues 1
Files 3
Review log 3847
Show 1622 earlier messages
-
crell uploaded patch set 1 05/16/22, 15:51
-
core-ci voted on patch set 1 V -1 05/16/22, 15:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27255
-
Oliver Klee commented on patch set 1 05/16/22, 16:19
As this change resolves a PHPStan warning, you'll need to update the PHPStan baseline file. -
crell uploaded patch set 2 05/16/22, 17:11
-
core-ci voted on patch set 2 V +1 05/16/22, 17:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27258
-
Oliver Klee voted on patch set 2 CR +1 05/16/22, 17:22
-
Oliver Klee commented on patch set 2 CR 0 05/16/22, 17:25
TargetPageIdViewHelper.php:48I think we're actually fixing a bug here as ! has a higher precedence than ===. So I propose making this a bugfix (with a correspondingly changed commit message), add a regression test and target this for "main, 11.5". What do you think? -
Oliver Klee commented on patch set 2 05/16/22, 17:25
TargetPageIdViewHelper.php:48Reply -
crell commented on patch set 2 05/16/22, 18:47
TargetPageIdViewHelper.php:48ReplyI think you're right, since the old code never passed to begin with. It probably still worked with the code below by accident. Will adjust. -
crell updated the commit message in patch set 3 05/16/22, 18:48
-
core-ci voted on patch set 3 V +1 05/16/22, 18:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27260
-
Stefan Bürk commented on patch set 3 05/16/22, 23:10
TargetPageIdViewHelper.php:48ReplyTo verify that this fixes a bug: https://3v4l.org/RR3ue Ack with Oliver, a regression test should be added to verify/cover this. -
crell uploaded patch set 4 05/17/22, 15:59
-
crell commented on patch set 4 05/17/22, 16:07
TargetPageIdViewHelper.php:48ReplyDone -
core-ci voted on patch set 4 V +1 05/17/22, 16:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27286
-
Oliver Klee commented on patch set 4 05/18/22, 16:31
TargetPageIdViewHelperTest.php:11Thanks for creating the testcase! For new tests, please directly add an @covers annotation to the class like this: /** * @covers \TYPO3\CMS\Redirects\ViewHelpers\TargetPageIdViewHelper */ (Please note the leading backslash, which makes is easier for human to see that the class name here is not namespace-aware.) This helps code coverage not have coverage for classes from tests that do not actually test that class.TargetPageIdViewHelperTest.php:16Please let's add the method name to the test name: https://speakerdeck.com/oliverklee/test-driven-development-with-phpunit-1?slide=49TargetPageIdViewHelperTest.php:18Please let's rename this variable for more context. ;- $context -> $renderingContext I'd also like to propose using a Prophecy stub of RenderingContextInterface instead of using the real class and overwriting the constructor to get it to hopefully not have any behavior anymore.TargetPageIdViewHelperTest.php:24In tests, please always use the strictest possible check in order to catch differences in behavior. In this case, please use assertSame insteads of equals. This catches type issues and avoids casts - just live === vs. == .TargetPageIdViewHelperTest.php:30The same points from the other test apply here. -
Oliver Klee wrote 05/18/22, 19:30
Removed reviewer Oliver Klee. -
crell uploaded patch set 5 05/18/22, 19:37
-
crell commented on patch set 4 05/18/22, 19:37
TargetPageIdViewHelperTest.php:11ReplyDoneTargetPageIdViewHelperTest.php:16ReplyDoneTargetPageIdViewHelperTest.php:18ReplyDoneTargetPageIdViewHelperTest.php:24ReplyDoneTargetPageIdViewHelperTest.php:30ReplyDone -
core-ci voted on patch set 5 V -1 05/18/22, 19:45 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27313
-
core-ci commented on patch set 5 05/18/22, 20:05 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27313
-
Stefan Bürk commented on patch set 5 05/18/22, 20:16
phpstan-baseline.neon:3069Why (and howre) are these removed ? Besides not valid and phpstan comlaining about it. ``` $ Build/Scripts/runTests.sh -s generatePhpstanBaseline ``` will add them again ....TargetPageIdViewHelperTest.php:4missing file header ``` /* * This file is part of the TYPO3 CMS project. * * It is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License, either version 2 * of the License, or any later version. * * For the full copyright and license information, please read the * LICENSE.txt file that was distributed with this source code. * * The TYPO3 project - inspiring people to share! */ ```TargetPageIdViewHelperTest.php:5fluid viewhelper tests has been refactored from unit to functional tests, for quite some reasons. Having this as functional test and avoiding stubbing/mocking/shallowing/castrate the rendering context at all.
-
crell commented on patch set 5 05/18/22, 20:29
phpstan-baseline.neon:3069ReplyAccidentally got copied over from another patch, I think. Will fix.TargetPageIdViewHelperTest.php:5ReplyWhat reasons? These particular tests have no dependencies, so making them functional tests just makes them slower for no benefit, no? -
Stefan Bürk commented on patch set 5 05/18/22, 22:43
TargetPageIdViewHelperTest.php:5ReplyViewHelper has often quite some dependencies. And mocking a lot of stuff is not that good. In that case, the tests are quite useless. The viewhelper uses the LinkService. So this test case could not be extended to test more with this viewhelper without moccking the linkservice etc. Having it as functional tests, this testcase can be extended easly and run with real page data and different t3:// page syntax links etc to see if the correct page id may be returned. But okay - let use the unit test for this for now. (More a fan of having the tests then together instead of splitted). -
crell commented on patch set 5 05/19/22, 14:02
TargetPageIdViewHelperTest.php:4ReplyDone -
crell uploaded patch set 6 05/19/22, 14:02
-
core-ci voted on patch set 6 V +1 05/19/22, 14:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27323
-
Stefan Bürk voted on patch set 6 V +1 CR +1 05/19/22, 15:09
-
Simon Schaufelberger voted on patch set 6 CR +1 05/20/22, 22:46
-
Christian Kuhn commented on patch set 6 CR -1 05/25/22, 08:03
TargetPageIdViewHelperTest.php:18wrong namespace -
Oliver Klee commented on patch set 6 05/25/22, 11:10
TargetPageIdViewHelperTest.php:43The @covers annotation usually should go into the comment for the test class, not into the comments of the test methods. -
Christian Kuhn commented on patch set 6 05/25/22, 12:20
TargetPageIdViewHelperTest.php:43Replyyeah. we tend to not have @covers at all: we're not measuring coverage anyways. -
Stefan Bürk voted on patch set 6 V 0 CR 0 05/25/22, 12:24
-
crell commented on patch set 6 05/27/22, 15:49
TargetPageIdViewHelperTest.php:18ReplyDoneTargetPageIdViewHelperTest.php:43ReplyOliver Klee recommended it specifically to avoid PHPUnit over-reading what the test hits. I don't much care either way. I've moved it to the class for now. -
crell uploaded patch set 7 05/27/22, 15:49
-
core-ci voted on patch set 7 V +1 05/27/22, 15:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27501
-
Stefan Bürk commented on patch set 7 CR -1 05/28/22, 21:42
TargetPageIdViewHelperTest.php:18Still wrong namespace, *must* be: ``` TYPO3\CMS\Redirects\Tests\Unit\ViewHelpers; ``` -
Simon Schaufelberger uploaded patch set 8 05/28/22, 22:48
-
Simon Schaufelberger commented on patch set 7 05/28/22, 22:48
TargetPageIdViewHelperTest.php:18ReplyFixed the wrong namespace for you. -
Simon Schaufelberger voted on patch set 8 V +1 CR +1 05/28/22, 22:49
-
Stefan Bürk voted on patch set 8 V +1 CR +1 05/28/22, 22:54
-
core-ci voted on patch set 8 V +1 05/28/22, 22:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27534
-
Stefan Bürk voted on patch set 8 V +2 CR +2 05/28/22, 22:57
-
Stefan Bürk merged patch set 9 05/28/22, 22:57
-
Stefan Bürk commented on patch set 9 05/28/22, 22:59
Note: Next time we should have the used command added to the commit message. -
Simon Schaufelberger commented on patch set 9 05/28/22, 23:01
Reply
indeed, I also overlooked that. sorry. -
Simon Schaufelberger commented on patch set 9 05/28/22, 23:09
Run comand: Build/Scripts/runTests.sh -s phpstanGenerateBaseline