Search in sources :

Example 1 with ConstantCanBeUsedInspector

use of com.kalessil.phpStorm.phpInspectionsEA.inspectors.apiUsage.ConstantCanBeUsedInspector in project phpinspectionsea by kalessil.

the class ConstantCanBeUsedInspectorTest method testIfFindsAllPatterns.

public void testIfFindsAllPatterns() {
    myFixture.enableInspections(new ConstantCanBeUsedInspector());
    myFixture.configureByFile("testData/fixtures/api/constants-usage.php");
    myFixture.testHighlighting(true, false, true);
    myFixture.getAllQuickFixes().forEach(fix -> myFixture.launchAction(fix));
    myFixture.setTestDataPath(".");
    myFixture.checkResultByFile("testData/fixtures/api/constants-usage.fixed.php");
}
Also used : ConstantCanBeUsedInspector(com.kalessil.phpStorm.phpInspectionsEA.inspectors.apiUsage.ConstantCanBeUsedInspector)

Example 2 with ConstantCanBeUsedInspector

use of com.kalessil.phpStorm.phpInspectionsEA.inspectors.apiUsage.ConstantCanBeUsedInspector in project phpinspectionsea by kalessil.

the class ConstantCanBeUsedInspectorTest method testIfFindsOsFamilyPatterns.

public void testIfFindsOsFamilyPatterns() {
    final PhpLanguageLevel level = PhpLanguageLevel.parse("7.3");
    if (level != null && level.getVersionString().equals("7.3")) {
        PhpProjectConfigurationFacade.getInstance(myFixture.getProject()).setLanguageLevel(level);
        myFixture.enableInspections(new ConstantCanBeUsedInspector());
        myFixture.configureByFile("testData/fixtures/api/constants-usage.php-os-family.php");
        myFixture.testHighlighting(true, false, true);
    }
}
Also used : ConstantCanBeUsedInspector(com.kalessil.phpStorm.phpInspectionsEA.inspectors.apiUsage.ConstantCanBeUsedInspector) PhpLanguageLevel(com.jetbrains.php.config.PhpLanguageLevel)

Aggregations

ConstantCanBeUsedInspector (com.kalessil.phpStorm.phpInspectionsEA.inspectors.apiUsage.ConstantCanBeUsedInspector)2 PhpLanguageLevel (com.jetbrains.php.config.PhpLanguageLevel)1