Skip to content

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Nov 10, 2019

fixes 2 of the 8 windows-only testfailures mentioned in #5 (comment)

* @param string $actual
* @param string $message
*/
protected function assertSamePaths(string $expected, string $actual, string $message = ''): void
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I put his helper in the base-class because I guess it can be re-used to fix a few of the remaining 6 windows-only testsuite errors

Copy link
Member

Choose a reason for hiding this comment

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

I agree with that, but try using FileHelper instead of str_replace.

Copy link
Member

Choose a reason for hiding this comment

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

If it doesn't succeed, I'm gonna merge this as it is.

Copy link
Contributor

Choose a reason for hiding this comment

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

using normalizePath will make the test error on windows travis CI

Copy link
Member

Choose a reason for hiding this comment

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

Looks like it passes.

protected function assertSamePaths(string $expected, string $actual, string $message = ''): void
{
$expected = str_replace('/', DIRECTORY_SEPARATOR, $expected);
$actual = str_replace('/', DIRECTORY_SEPARATOR, $actual);
Copy link
Member

Choose a reason for hiding this comment

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

Try $this->getFileHelper()->normalizePath() for the same result. Otherwise good idea!

@ondrejmirtes ondrejmirtes merged commit 4941c5a into phpstan:master Nov 11, 2019
@ondrejmirtes
Copy link
Member

Thank you!

@staabm staabm deleted the win-tests branch November 11, 2019 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants