Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--no-extensions CLI option does not work #5666

Closed
nightio opened this issue Jan 15, 2024 · 0 comments
Closed

--no-extensions CLI option does not work #5666

nightio opened this issue Jan 15, 2024 · 0 comments
Labels
feature/test-runner CLI test runner type/bug Something is broken version/9 Something affects PHPUnit 9

Comments

@nightio
Copy link

nightio commented Jan 15, 2024

Continuation of #5073

Q A
PHPUnit version 9.6.15
PHP version 8.2.14
Installation Method Composer

Summary

the --no-extensions cli option does not apply to the element configured in the config file

Current behavior

while passing the --no-extensions cli option, extensions configured in the extension element of phpunit.xml are loaded when running phpunit.

How to reproduce

Add any extensions to the configuration. Run tests with --no-extensions.
Extensions are loaded.

Expected behavior.

The extensions configured in the extension element are not loaded

A potential issue

if (!isset($this->arguments['noExtensions'])) {

The $this->arguments variable used isn't defined. There is no $this->arguments variable, only $arguments.

Solution proposal

Replace $this->arguments with $arguments

@nightio nightio added type/bug Something is broken version/9 Something affects PHPUnit 9 labels Jan 15, 2024
nightio pushed a commit to nightio/phpunit that referenced this issue Jan 15, 2024
@sebastianbergmann sebastianbergmann changed the title --no-extensions does not work with extensions defined in config file --no-extensions CLI option does not work Jan 15, 2024
@sebastianbergmann sebastianbergmann added the feature/test-runner CLI test runner label Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/test-runner CLI test runner type/bug Something is broken version/9 Something affects PHPUnit 9
Projects
None yet
Development

No branches or pull requests

2 participants