Search in sources :

Example 1 with CascadeStringReplacementInspector

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

the class CascadeStringReplacementInspectorTest method testIfFindsPhp74Patterns.

public void testIfFindsPhp74Patterns() {
    final PhpLanguageLevel level = PhpLanguageLevel.parse("7.4");
    if (level != null && level.getVersionString().equals("7.4")) {
        PhpProjectConfigurationFacade.getInstance(myFixture.getProject()).setLanguageLevel(level);
        final CascadeStringReplacementInspector inspector = new CascadeStringReplacementInspector();
        inspector.USE_SHORT_ARRAYS_SYNTAX = true;
        myFixture.enableInspections(inspector);
        myFixture.configureByFile("testData/fixtures/api/strings/cascade-str-replace.74.php");
        myFixture.testHighlighting(true, false, true);
        myFixture.getAllQuickFixes().forEach(fix -> myFixture.launchAction(fix));
        myFixture.setTestDataPath(".");
        myFixture.checkResultByFile("testData/fixtures/api/strings/cascade-str-replace.74.fixed.php");
    }
}
Also used : CascadeStringReplacementInspector(com.kalessil.phpStorm.phpInspectionsEA.inspectors.apiUsage.strings.CascadeStringReplacementInspector) PhpLanguageLevel(com.jetbrains.php.config.PhpLanguageLevel)

Example 2 with CascadeStringReplacementInspector

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

the class CascadeStringReplacementInspectorTest method testIfFindsAllPatterns.

public void testIfFindsAllPatterns() {
    final CascadeStringReplacementInspector inspector = new CascadeStringReplacementInspector();
    inspector.USE_SHORT_ARRAYS_SYNTAX = true;
    myFixture.enableInspections(inspector);
    myFixture.configureByFile("testData/fixtures/api/strings/cascade-str-replace.php");
    myFixture.testHighlighting(true, false, true);
    myFixture.getAllQuickFixes().forEach(fix -> myFixture.launchAction(fix));
    myFixture.setTestDataPath(".");
    myFixture.checkResultByFile("testData/fixtures/api/strings/cascade-str-replace.fixed.php");
}
Also used : CascadeStringReplacementInspector(com.kalessil.phpStorm.phpInspectionsEA.inspectors.apiUsage.strings.CascadeStringReplacementInspector)

Aggregations

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