Review main Merged

76390[TASK] Replace prophecy in EXT:core PasswordHashFactoryTest

Nikita Hovratov CR +2 V +2 Easy +11 −20 updated 11/03/22, 09:36

Commit message

Review

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

Issues 1

Files 1

Review log 1416

  1. Nikita Hovratov uploaded patch set 1 11/02/22, 17:21

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

  3. Oliver Klee commented on patch set 1 CR -1 11/02/22, 17:36

    PasswordHashFactoryTest.php:88

    We should use a mock for this. Otherwise, we cannot assert that the method actually gets called (which is part of the Prophecy version of the test).

    PasswordHashFactoryTest.php:221

    Ditto.
  4. Christian Kuhn commented on patch set 1 11/02/22, 17:47

    PasswordHashFactoryTest.php:88 Reply

    i don't agree: the test-goal is achieved by testing for the exception already?!

    PasswordHashFactoryTest.php:221 Reply

    i don't agree: the test-goal is achieved by testing for the exception already?!
  5. Oliver Klee commented on patch set 1 11/02/22, 17:58

    PasswordHashFactoryTest.php:88 Reply

    This depends on whether we define the check for availability to be part of the test statement. I don't really know the code - do you know more about whether the call to isAvailable is relevant?
  6. Nikita Hovratov commented on patch set 1 11/02/22, 18:36

    PasswordHashFactoryTest.php:88 Reply

    The exception raise already implicates that isAvailable was called. Otherwise the test would fail. So it is redundant. Whitebox testing should be avoided as much as possible anyway.
  7. Oliver Klee commented on patch set 1 11/03/22, 08:43

    Talked with lolli about this, and we came to the conclusion that the call to isAvailable() actually is relevant to the test, and having a green test when the call is removed from the production code would be incorrect. New patchset coming up in a second.
  8. Oliver Klee commented on patch set 1 11/03/22, 08:44

    PasswordHashFactoryTest.php:88 Reply

    Done

    PasswordHashFactoryTest.php:221 Reply

    Done
  9. Oliver Klee uploaded patch set 2 11/03/22, 08:44

  10. Oliver Klee voted on patch set 2 CR +1 11/03/22, 08:44

  11. core-ci voted on patch set 2 V +1 11/03/22, 08:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33022

  12. Oliver Klee voted on patch set 2 V +1 11/03/22, 08:53

  13. Nikita Hovratov voted on patch set 2 V +1 CR +1 11/03/22, 09:06

  14. Nikita Hovratov commented on patch set 2 11/03/22, 09:10

    Reply

    Ack
  15. Stefan Bürk voted on patch set 2 V +2 CR +2 11/03/22, 09:36

  16. Stefan Bürk merged patch set 3 11/03/22, 09:36