Skip to content

Make the root package name and path dynamically discovered in MakerTestCase#1770

Merged
GromNaN merged 1 commit into
symfony:1.xfrom
GromNaN:relative-path
Feb 12, 2026
Merged

Make the root package name and path dynamically discovered in MakerTestCase#1770
GromNaN merged 1 commit into
symfony:1.xfrom
GromNaN:relative-path

Conversation

@GromNaN
Copy link
Copy Markdown
Member

@GromNaN GromNaN commented Jan 8, 2026

An issue when using the MakerTestCase to test maker classes provided by other packages, is that it depends on the tests directory of the symfony/maker-bundle package.

In this PR, we use Composer\InstalledVersions::getRootPackage() to retrieve the path and name of the root package under test. This way, that's the tested package that is linked into the temporary test projects.

This assumes a certain structure of the maker package (src, tests and tests/fixtures dirs, tests/tmp ignored, tools/twigcs subproject).

@GromNaN GromNaN added the Feature New Feature label Jan 8, 2026
@GromNaN GromNaN requested a review from jrushlow January 9, 2026 09:31
Comment thread src/Test/MakerTestEnvironment.php Outdated
Comment thread src/Test/MakerTestEnvironment.php
@GromNaN GromNaN changed the title Make the package name and root dynamically discovered in MakerTestCase Make the root package name and path dynamically discovered in MakerTestCase Jan 9, 2026
Comment thread src/Test/MakerTestEnvironment.php Outdated
}

public function runCommand(string $command): MakerTestProcess
public function runCommand(string|array $command): MakerTestProcess
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a breaking change because the class is internal.

}

public static function create($commandLine, $cwd, array $envVars = [], $timeout = null): self
public static function create(string|array $commandLine, string $cwd, array $envVars = [], ?float $timeout = null): self
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a breaking change because the class is final and internal

Comment thread src/Test/MakerTestEnvironment.php
@GromNaN GromNaN force-pushed the relative-path branch 2 times, most recently from 2706e4a to b481981 Compare February 10, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature New Feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants