Skip to content

[Bug] Unit test for overridden properties in Magento.Files.LineLength doesn't work as expected #36

Closed
@lenaorobei

Description

@lenaorobei

Rule from ruleset.xml

    <rule ref="Magento.Files.LineLength">
        <properties>
            <property name="lineLimit" value="120"/>
            <property name="absoluteLineLimit" value="120"/>
        </properties>
        <type>warning</type>
        <severity>6</severity>
    </rule>

Properties from parent Generic.Files.LineLength sniff are processed instead of changed in Magento.Files.LineLength values.

Steps to reproduce

  1. Create test fixture with line length = 101.

Expected result

  1. Unit test does not detect warning.

Actual result

[LINE 2] Expected 0 error(s) and 1 warning(s) in LineLengthUnitTest.inc but found 1 error(s) and 0 warning(s). The error(s) found were:
 -> Line exceeds maximum limit of 100 characters; contains 101 characters (Magento.Files.LineLength.MaxExceeded)

Discovered while implementing Unit test for LineLengthSniff.

Metadata

Metadata

Assignees

Labels

acceptedNew rule is acceptedbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions