Skip to content
This repository was archived by the owner on Jul 12, 2020. It is now read-only.
This repository was archived by the owner on Jul 12, 2020. It is now read-only.

fix-class-names fails when class and base class is renamed #60

Description

@david0

fix-class-names fails with DeletedLineException when the class itself and the base class should be renamed.

Testcase:

Scenario: "Rename class and its base class"
    Given a PHP File named "src/Foo/Boing.php" with:
        """
        <?php
        namespace Foo;

        class Foo extends Baes
        {
        }
        """
    Given a PHP File named "src/Foo/Base.php" with:
        """
        <?php
        namespace Foo;
        class Baes 
        {
        } 
        """
    When I use refactoring "fix-class-names" with:
        | arg   | value |
        | dir   | src/  |
    Then the PHP File "src/Foo.php" should be refactored:
        """
        --- a/vfs://project/src/src/Foo/Boing.php
        +++ b/vfs://project/src/src/Foo/Boing.php
        @@ -1,6 +1,6 @@
         <?php
         namespace Foo;

        -class Foo extends Baes
        +class Boing extends Base
         {
         }

        --- a/vfs://project/src/Foo/Base.php
        +++ b/vfs://project/src/Foo/Base.php
        @@ -1,5 +1,5 @@
         <?php
         namespace Foo;
        -class Baes 
        +class Base 
         {
         }           
        """

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions