Skip to content

Commit

Permalink
Support recovery token revocation in tests
Browse files Browse the repository at this point in the history
The CommandAuthorizationServiceTest did not yet correctly support the RT
revocation scenario. Resulting in two failing tests. They were
previously under the radar as the phpunit scritp would still return a 0
exit code even tho the tests failed.

That was remedied by adding a 'set -e' instruction to that file
  • Loading branch information
MKodde committed Feb 20, 2024
1 parent 305a963 commit 8f378f5
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
use Surfnet\StepupMiddleware\CommandHandlingBundle\Command\SelfServiceExecutable;
use Surfnet\StepupMiddleware\CommandHandlingBundle\Identity\Command\CreateIdentityCommand;
use Surfnet\StepupMiddleware\CommandHandlingBundle\Identity\Command\ExpressLocalePreferenceCommand;
use Surfnet\StepupMiddleware\CommandHandlingBundle\Identity\Command\RevokeRegistrantsRecoveryTokenCommand;
use Surfnet\StepupMiddleware\CommandHandlingBundle\Identity\Command\RevokeRegistrantsSecondFactorCommand;
use Surfnet\StepupMiddleware\CommandHandlingBundle\Identity\Command\UpdateIdentityCommand;
use Surfnet\StepupMiddleware\CommandHandlingBundle\Identity\Command\VetSecondFactorCommand;
Expand Down Expand Up @@ -210,7 +211,10 @@ public function an_identity_should_be_able_to_execute_configured_ra_commands($fi
);

$role = RegistrationAuthorityRole::raa();
if ($command instanceof VetSecondFactorCommand || $command instanceof RevokeRegistrantsSecondFactorCommand) {
if ($command instanceof VetSecondFactorCommand
|| $command instanceof RevokeRegistrantsSecondFactorCommand
|| $command instanceof RevokeRegistrantsRecoveryTokenCommand
) {
$role = RegistrationAuthorityRole::ra();
$mockInstitution = new Institution('mock institution');
$mockIdentity = m::mock(Identity::class);
Expand Down Expand Up @@ -375,7 +379,10 @@ public function an_identity_should_be_able_to_execute_unconfigured_ra_commands($
);

$role = RegistrationAuthorityRole::raa();
if ($command instanceof VetSecondFactorCommand || $command instanceof RevokeRegistrantsSecondFactorCommand) {
if ($command instanceof VetSecondFactorCommand
|| $command instanceof RevokeRegistrantsSecondFactorCommand
|| $command instanceof RevokeRegistrantsRecoveryTokenCommand
) {
$role = RegistrationAuthorityRole::ra();
$mockInstitution = new Institution('mock institution');
$mockIdentity = m::mock(Identity::class);
Expand Down

0 comments on commit 8f378f5

Please sign in to comment.