store($userId, $identifier, $secrets); $received = $credentialsManager->retrieve($userId, $identifier); $this->assertSame($secrets, $received); $removedRows = $credentialsManager->delete($userId, $identifier); $this->assertSame(1, $removedRows); } /** * @dataProvider credentialsProvider */ public function testUpdate($userId, $identifier): void { $credentialsManager = Server::get(ICredentialsManager::class); $secrets = 'Open Sesame'; $secretsRev = strrev($secrets); $credentialsManager->store($userId, $identifier, $secrets); $credentialsManager->store($userId, $identifier, $secretsRev); $received = $credentialsManager->retrieve($userId, $identifier); $this->assertSame($secretsRev, $received); } public function credentialsProvider(): array { return [ [ 'alice', 'privateCredentials' ], [ '', 'systemCredentials', ], ]; } }