gerardroche / sublime-phpunit

PHPUnit Sublime Text integration.
https://www.gerardroche.com
GNU General Public License v3.0
74 stars 11 forks source link

Some options won't change #100

Closed ian-nisbet closed 1 year ago

ian-nisbet commented 3 years ago

In ST4, whatever I set phpunit.options to, the resultant command will always include ( with data set .+)?$ --colors=never -d memory_limit=-1 -d testdox=true --no-coverage I am therefore not able to change the testdox, colors or memory_limit settings

If I change other phpunit settings, such as phpunit.composer, then the changes are applied and influence it.

Maybe unrelated, "phpunit.strategy": "iTerm2.app", does not have any affect also.

gerardroche commented 3 years ago

Can you show the settings for phpunit.options?

Here is my own:

    "phpunit.options":
    {
        "no-coverage": true,
    },

Here is the default:

    // Command-line options to pass to PHPUnit.
    // https://phpunit.de/manual/current/en/textui.html#textui.clioptions
    // e.g. `{"no-coverage": true, "verbose": true}`
    "phpunit.options": {},
gerardroche commented 3 years ago

Sounds related to https://github.com/gerardroche/sublime-phpunit/issues/95.

ian-nisbet commented 3 years ago

I read through #95 and tried logging as suggested, but did not find out anything useful. However, I noticed that when I open Sublime Text with subl ./ all of the options are respected. However, when I open an existing project or switch to the same project, then the problem occurs. If I open a different project, then there is no problem. So it makes me think that there is some project level settings cache in Sublime?

Here is the options setting:

"phpunit.options": {
    "d": ["memory_limit=-1"],
  },

When it is working, then I see the following test command

/Users/mymac/Sites/rma/vendor/bin/phpunit --filter ::test(DateValidation)( with data set .+)?$ -d memory_limit=-1 tests/Unit/Logic/JobsDatesTest.php

When it is not, the following

/Users/mymac/Sites/client-api/vendor/bin/phpunit --filter ::(can_make_assertions)( with data set .+)?$ --colors=never -d memory_limit=-1 -d testdox=true --no-coverage tests/Feature/ExampleEmptyDatabaseTest.php

ian-nisbet commented 3 years ago

I found that the .sublime-workspace file was caching all of the phpunit.options settings. Only by deleting this file and restarting Sublime Text, was the issue resolved.

gerardroche commented 1 year ago

These type of issues are incredibly difficult to reproduce. Usually clearing caches like workspace files, closing all views and restarting fresh resolves it. Until I can reproduce the issues I can't find workarounds of pre-emptive fixes.

Closing for now, but if you encounter it again and can reproduce let me know.