Review main Merged

73228[TASK] Resolve some 'access to undefined property' in tests

Christian Kuhn CR +2 V +2 Normal +40 −144 updated 01/30/22, 21:56

Commit message

Various tests add subjects or mocks as class
property without declaring the property.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Jochen Roth +1
    • Stefan Bürk +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Jochen Roth +1
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 1

Files 10

Review log 1113

  1. Christian Kuhn uploaded patch set 1 01/30/22, 18:50

  2. core-ci voted on patch set 1 V +1 01/30/22, 19:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22738

  3. Oliver Klee commented on patch set 1 01/30/22, 19:06

    AdminPanelInitiatorTest.php:62

    Those kinds of annotations can be improved in two ways: 1. use the intersection type: ObjectProphecy&… (as the prophecy has both classes/interfaces at the same time) 2. use the class that is provided to prophesize, i.e., FrontendBackendUserAuthentication instead of FrontendBackendUserAuthentication|BackendUserAuthentication
  4. Christian Kuhn commented on patch set 1 01/30/22, 19:15

    AdminPanelInitiatorTest.php:62 Reply

    tried that. did not work. imho the phpstan prophecy plugin is incomplete when *properties* of prophec'ied classes are changed. could you play around on that a bit and come up with something better that works? i failed to do so and left the other places as is (for instance the very same thing in ConfigurationServiceTest.php.
  5. Oliver Klee commented on patch set 1 01/30/22, 19:19

    AdminPanelInitiatorTest.php:62 Reply

    Yes, I will have a try.
  6. Christian Kuhn commented on patch set 1 01/30/22, 21:37

    AdminPanelInitiatorTest.php:62 Reply

    i'll drop this one from the patch for now - phpstan-prophecy imho needs some love for this.
  7. Christian Kuhn uploaded patch set 2 01/30/22, 21:38

  8. Christian Kuhn commented on patch set 2 01/30/22, 21:39

    AdminPanelInitiatorTest.php:62 Reply

    Done
  9. core-ci voted on patch set 2 V +1 01/30/22, 21:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22751

  10. Jochen Roth voted on patch set 2 V +1 CR +1 01/30/22, 21:54

  11. Stefan Bürk voted on patch set 2 V +1 CR +1 01/30/22, 21:55

  12. Christian Kuhn voted on patch set 2 V +2 CR +2 01/30/22, 21:56

  13. Christian Kuhn merged patch set 3 01/30/22, 21:56