Search in sources :

Example 1 with PropertyInitializationFlawsInspector

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

the class PropertyInitializationFlawsInspectorTest method testPropertyOverridePatterns.

public void testPropertyOverridePatterns() {
    final PropertyInitializationFlawsInspector inspector = new PropertyInitializationFlawsInspector();
    myFixture.enableInspections(inspector);
    myFixture.configureByFile("testData/fixtures/codeStyle/property-initialization-override.php");
    myFixture.testHighlighting(true, false, true);
}
Also used : PropertyInitializationFlawsInspector(com.kalessil.phpStorm.phpInspectionsEA.inspectors.apiUsage.PropertyInitializationFlawsInspector)

Example 2 with PropertyInitializationFlawsInspector

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

the class PropertyInitializationFlawsInspectorTest method testNullInitPatterns.

public void testNullInitPatterns() {
    final PropertyInitializationFlawsInspector inspector = new PropertyInitializationFlawsInspector();
    inspector.REPORT_INIT_FLAWS = true;
    inspector.REPORT_DEFAULTS_FLAWS = true;
    myFixture.enableInspections(inspector);
    myFixture.configureByFile("testData/fixtures/codeStyle/property-null-initialization.php");
    myFixture.testHighlighting(true, false, true);
    myFixture.getAllQuickFixes().forEach(fix -> myFixture.launchAction(fix));
    myFixture.setTestDataPath(".");
    myFixture.checkResultByFile("testData/fixtures/codeStyle/property-null-initialization.fixed.php");
}
Also used : PropertyInitializationFlawsInspector(com.kalessil.phpStorm.phpInspectionsEA.inspectors.apiUsage.PropertyInitializationFlawsInspector)

Example 3 with PropertyInitializationFlawsInspector

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

the class PropertyInitializationFlawsInspectorTest method testTypedPropertiesPatterns.

public void testTypedPropertiesPatterns() {
    final PhpLanguageLevel level = PhpLanguageLevel.parse("7.4");
    if (level != null && level.getVersionString().equals("7.4")) {
        PhpProjectConfigurationFacade.getInstance(myFixture.getProject()).setLanguageLevel(level);
        myFixture.enableInspections(new PropertyInitializationFlawsInspector());
        myFixture.configureByFile("testData/fixtures/codeStyle/property-initialization-typed-properties.php");
        myFixture.testHighlighting(true, false, true);
    }
}
Also used : PropertyInitializationFlawsInspector(com.kalessil.phpStorm.phpInspectionsEA.inspectors.apiUsage.PropertyInitializationFlawsInspector) PhpLanguageLevel(com.jetbrains.php.config.PhpLanguageLevel)

Example 4 with PropertyInitializationFlawsInspector

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

the class PropertyInitializationFlawsInspectorTest method testClassReferenceResolvingPatterns.

public void testClassReferenceResolvingPatterns() {
    final PropertyInitializationFlawsInspector inspector = new PropertyInitializationFlawsInspector();
    myFixture.enableInspections(inspector);
    myFixture.configureByFile("testData/fixtures/codeStyle/property-initialization-class-references.php");
    myFixture.testHighlighting(true, false, true);
}
Also used : PropertyInitializationFlawsInspector(com.kalessil.phpStorm.phpInspectionsEA.inspectors.apiUsage.PropertyInitializationFlawsInspector)

Aggregations

PropertyInitializationFlawsInspector (com.kalessil.phpStorm.phpInspectionsEA.inspectors.apiUsage.PropertyInitializationFlawsInspector)4 PhpLanguageLevel (com.jetbrains.php.config.PhpLanguageLevel)1