We have a multi language org and the system administrators also use different languages when administrating the Salesforce org.
This creates a problem when running unit tests. Some unit tests want to test functionality as a user with a specific profile, e.g. the standard Salesforce 'System Administrator' profile. So we have to create a user inside the test, with that profile. This is a line from the unit test:
Profile p = [SELECT Id FROM Profile WHERE (Name = 'System Administrator') OR (Name = 'Systeembeheerder')][0];
This way, unit tests can be run by admins who use one of two languages. How can we make this code language independent? I haven't found something like a DeveloperName attribute for Profile.
A solution would be to clone the standard profile to a custom profile, because the names of custom profiles are fixed and thus language independent, but I would like to know if someone has a better idea.