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

refactor: tidy up command line in tests #682

Merged
merged 3 commits into from
Oct 12, 2020
Merged

Conversation

szepeviktor
Copy link
Collaborator

@szepeviktor szepeviktor commented Oct 10, 2020

  1. introduce dirname
  2. proper CLI options
  3. indent code
  4. support Windows

Fixes #681

@szepeviktor
Copy link
Collaborator Author

szepeviktor commented Oct 11, 2020

@xitox97 Please run php path\to\composer run-script test:unit with this branch.


...not really Windows junctions: Composer substitutes vendor/bin/* symlinks on Windows with POSIX shell scripts,
junctions are created by Cygwin

@canvural
Copy link
Collaborator

Hi,

Thank you very much for digging into this issue!

Using the dirname function is for supporting Windows? If so can you also change the usages in tests/Rules folder? For example here: https://github.com/nunomaduro/larastan/blob/master/tests/Rules/ModelPropertyRuleTest.php#L13 I believe this will fix the rest of the errors @xitox97 getting

@szepeviktor
Copy link
Collaborator Author

szepeviktor commented Oct 12, 2020

Using the dirname function is for supporting Windows?

No, there are several forward slashes in several paths causing no problems.
Using real PHPStan path /vendor/phpstan/phpstan/phpstan makes Windows work.
/vendor/bin/phpstan is a shell script on Windows 🤯 thus php.exe cannot execute it.

@canvural canvural changed the title Tidy up command line in tests refactor: tidy up command line in tests Oct 12, 2020
@canvural canvural merged commit 03c32ab into master Oct 12, 2020
@canvural canvural deleted the szepeviktor-patch-1 branch October 12, 2020 21:46
@canvural
Copy link
Collaborator

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unit test problem on MINGW64
2 participants