According to the documentation of the Prophecy mocking framework if you do repeated calls to the same method with identical arguments, then the same result will always be returned (see the section Method prophecies idempotency).
In GroupManagerTest we are violating this principle repeatedly. We're doing multiple calls to Config::get('groups') but we are expecting different results to be returned from it. An example:
According to the documentation of the Prophecy mocking framework if you do repeated calls to the same method with identical arguments, then the same result will always be returned (see the section Method prophecies idempotency).
In
GroupManagerTest
we are violating this principle repeatedly. We're doing multiple calls toConfig::get('groups')
but we are expecting different results to be returned from it. An example:In reality the
$groups_before
value will never be returned, instead the$groups_after
value will always be returned.The test currently only works because the initial values that are returned by the mock are not actually used anywhere in the code.
We should fix this according to the "promises" example that is mentioned in that section of the Prophecy documentation.