phpunitgen-console icon indicating copy to clipboard operation
phpunitgen-console copied to clipboard

TargetGenerator paths don't respect PSR 4

Open landure opened this issue 2 years ago • 1 comments

Subject of the issue

TargetGenerator doesn't take baseTestNamespace and autoload configuration when generating file name.

Your environment

  • version of phpunitgen/core: 3.1.0
  • version of phpunitgen/console: 5.0.0

Steps to reproduce

  1. Set baseTestNamespace to 'Tests\Unit' in phpunitgen.php

  2. Set composer.json autoload-dev to

    "autoload-dev": {
      "psr-4": {
        "Tests\\": "testing"
      }
    },
    
  3. Generate a unit test without specifying a base path.

Expected behavior

TargetGenerator should use Composer autoload-dev config to determine the path where to create the generated unit test files when a target path isn't specified on command-line. TargetGenerator should also base file path based on baseTestNamespace.

Actual behavior

The test file path doesn't contains Unit and the file is created in tests folder instead of testing. The generated test doesn't respect PSR4.

landure avatar Dec 06 '23 14:12 landure

@landure I don't have the time to manage this for now, as I'm working on other OOS. PR welcome on this.

paul-thebaud avatar Dec 17 '23 13:12 paul-thebaud

Closing as I'm archiving the project. See the https://github.com/paul-thebaud/phpunitgen-core/issues/32.

paul-thebaud avatar Apr 18 '24 20:04 paul-thebaud