registry = $this->createMock(IRegistry::class); $this->userManager = $this->createMock(IUserManager::class); $cmd = new Cleanup($this->registry, $this->userManager); $this->cmd = new CommandTester($cmd); } public function testCleanup(): void { $this->registry->expects($this->once()) ->method('cleanUp') ->with('u2f'); $rc = $this->cmd->execute([ 'provider-id' => 'u2f', ]); $this->assertEquals(0, $rc); $output = $this->cmd->getDisplay(); $this->assertStringContainsString('All user-provider associations for provider u2f have been removed', $output); } }