DrupalProfileDefinition implements BuiltInQualityProfilesDefinition { @Override public void define(Context context) { NewBuiltInQualityProfile profile = context.createBuiltInQualityProfile("Drupal", Php.KEY); XmlProfileParser.parse("org/sonar/plugins/php/profile/drupal-profile.xml", profile); profile.done(); }  @Override void define(Context context);  }
@Test public void profile_creation() { Context context = new Context(); new DrupalProfileDefinition().define(context); BuiltInQualityProfile profile = context.profile("php", "Drupal"); assertThat(profile.language()).isEqualTo(Php.KEY); assertThat(profile.name()).isEqualTo("Drupal"); assertThat(profile.rules()).hasSize(21); BuiltInActiveRule lineLengthRule = profile.rule(RuleKey.of("php", "S103")); assertThat(lineLengthRule.overriddenParam("maximumLineLength").overriddenValue()).isEqualTo("140"); BuiltInActiveRule ruleS4833 = profile.rule(RuleKey.of("php", "S4833")); assertThat(ruleS4833.overriddenParams()).isEmpty(); }