Skip to content

PhpUnitDataProviderMethodOrderFixer is broken #19059

@mvorisek

Description

@mvorisek

Description

The following code:

config: https://github.com/atk4/data/blob/dbfe7b5b546df2127a2c6ca209595ff7c29db7a0/.php-cs-fixer.dist.php

code: https://github.com/atk4/data/blob/dbfe7b5b546df2127a2c6ca209595ff7c29db7a0/tests/Ssh/ForUpdateLocking/Test.php

Resulted in this output:

PHP CS Fixer 3.80.0 Alexander by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.3.22
Running analysis on 1 core sequentially.
You can enable parallel runner and speed up the analysis! Please see https://cs.symfony.com/doc/usage.html for more information.
Loaded config default from "/__w/data/data/.php-cs-fixer.dist.php".

...

Files that were not fixed due to errors reported during fixing:
   1) C:\...\tests\Ssh\ForUpdateLocking\Test.php


        [AssertionError]
        assert(false !== $iToMove) (1)


      assert()
        in C:\...\vendor\friendsofphp\php-cs-fixer\src\Fixer\PhpUnit\PhpUnitDataProviderMethodOrderFixer.php at line 201
      PhpCsFixer\Fixer\PhpUnit\PhpUnitDataProviderMethodOrderFixer->moveMethodElement()
        in C:\...\vendor\friendsofphp\php-cs-fixer\src\Fixer\PhpUnit\PhpUnitDataProviderMethodOrderFixer.php at line 133
      PhpCsFixer\Fixer\PhpUnit\PhpUnitDataProviderMethodOrderFixer->applyPhpUnitClassFix()
        in C:\...\vendor\friendsofphp\php-cs-fixer\src\Fixer\AbstractPhpUnitFixer.php at line 47      PhpCsFixer\Fixer\AbstractPhpUnitFixer->applyFix()
        in C:\...\vendor\friendsofphp\php-cs-fixer\src\AbstractFixer.php at line 54
      PhpCsFixer\AbstractFixer->fix()
        in C:\...\vendor\friendsofphp\php-cs-fixer\src\Runner\Runner.php at line 444
      PhpCsFixer\Runner\Runner->fixFile()
        in C:\...\vendor\friendsofphp\php-cs-fixer\src\Runner\Runner.php at line 385
      PhpCsFixer\Runner\Runner->fixSequential()
        in C:\...\vendor\friendsofphp\php-cs-fixer\src\Runner\Runner.php at line 173
      PhpCsFixer\Runner\Runner->fix()
        in C:\...\vendor\friendsofphp\php-cs-fixer\src\Console\Command\FixCommand.php at line 366
      PhpCsFixer\Console\Command\FixCommand->execute()
        in C:\...\vendor\symfony\console\Command\Command.php at line 298
      [ ... ]

PHP Version

PHP 8.3.22 (cli) (built: Jul  1 2025 04:45:01) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.22, Copyright (c) Zend Technologies
    with Zend OPcache v8.3.22, Copyright (c), by Zend Technologies

Operating System

Linux and Windows

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions