Review main Merged

80870[TASK] Add tests to show working regexp redirects with query parameter

Stefan Bürk CR +2 V +2 Normal +60 −0 updated 09/06/23, 20:26

Commit message

With #101739 a bug has been reported, which is
not correct.

This change adds functional tests to `ext:redirects`
to show and cover that:

* regexp redirects with a pattern not covering params
  but query arguments are given in the request uri and
  "Respect GET Parameters" has been set do not redirect.
* RegExp Redirects with a pattern not covering params
  and no GET arguments are given in the request uri but
  "Respect GET Parameters" has been set redirects to the
  target url.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Benjamin Franzke +1
    • Oliver Klee +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Benjamin Franzke +1
    • Oliver Klee +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 1924

  1. Stefan Bürk uploaded patch set 1 09/05/23, 15:05

  2. core-ci voted on patch set 1 V +1 09/05/23, 15:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46244

  3. Stefan Bürk updated the commit message in patch set 2 V +1 09/05/23, 15:14

  4. Stefan Bürk uploaded patch set 3 09/05/23, 15:16

  5. Oliver Klee commented on patch set 2 09/05/23, 15:18

    RedirectServiceTest.php:363

    I generally recommend using `assertSame` as much as possible over `assertEquals` as this then does a strict check (like `===` instead of `==`), and we want our tests to be as strict as possible to avoid "close, but still not exactly what we wanted" false green tests. :-) (We then should only use `assertEquals` where we explicitly want to do a non-strict check.)
  6. Oliver Klee commented on patch set 3 09/05/23, 15:19

    RedirectServiceTest.php:316

    Why this change?
  7. core-ci voted on patch set 3 V +1 09/05/23, 15:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46247

  8. Stefan Bürk commented on patch set 3 09/05/23, 15:51

    RedirectServiceTest.php:363 Reply

    Ack. Had that for other test recently too. Sadly, I just copied other tests for this and not rechecking the exact assert call.
  9. Stefan Bürk uploaded patch set 4 V +1 09/05/23, 15:52

  10. Stefan Bürk uploaded patch set 5 09/05/23, 15:53

  11. Stefan Bürk commented on patch set 5 09/05/23, 15:54

    RedirectServiceTest.php:316 Reply

    Done

    RedirectServiceTest.php:363 Reply

    Done
  12. Stefan Bürk commented on patch set 5 09/05/23, 15:54

    RedirectServiceTest.php:316 Reply

    Left over. First tried to add it to that test before making two dedicated test methods.
  13. core-ci voted on patch set 4 V +1 09/05/23, 16:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46250

  14. core-ci voted on patch set 5 V +1 09/05/23, 16:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46251

  15. Oliver Klee voted on patch set 5 V +1 09/05/23, 17:05

  16. Benjamin Franzke voted on patch set 5 V +1 CR +1 09/05/23, 22:36

  17. Oliver Klee commented on patch set 5 09/06/23, 07:52

    RedirectServiceTest.php:344

    Instead of "DoesNotRedirect" ("what does it not do"), I propose stating what it does instead: `regexpWithNoParamRegexpAndRespectingGetParameteresIssuesNotFoundStatusIfParamsAreGivenInUrl`

    RedirectServiceTest.php:370

    There's an "s" missing: `regexpWithNoParamRegexpAndRespectingGetParameteresRedirectsIfNoParamsAreGiven`
  18. Stefan Bürk uploaded patch set 6 CR +1 V +1 09/06/23, 08:47

  19. Stefan Bürk commented on patch set 6 09/06/23, 08:48

    RedirectServiceTest.php:344 Reply

    Done

    RedirectServiceTest.php:370 Reply

    Done
  20. Benjamin Franzke voted on patch set 6 V +1 CR +1 09/06/23, 08:51

  21. Oliver Klee voted on patch set 6 V +1 CR +1 09/06/23, 08:53

  22. core-ci voted on patch set 6 V +1 09/06/23, 08:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46271

  23. Stefan Bürk voted on patch set 6 V +2 CR +2 09/06/23, 20:13

  24. Stefan Bürk merged patch set 7 09/06/23, 20:26