Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Php unit windows #5369

Closed
wants to merge 11 commits into from
Closed

Php unit windows #5369

wants to merge 11 commits into from

Conversation

ThaDafinser
Copy link
Contributor

Under windows there are currently a lot of failing tests.

Most problem is \n instead of \r\n.

Some of the problems are fixed with this PR.

@ThaDafinser ThaDafinser mentioned this pull request Oct 28, 2013
@turrsis
Copy link
Contributor

turrsis commented Oct 28, 2013

@ThaDafinser I use bat file for Windows context menu:
....\php .....\php-cs-fixer.phar fix %1 --level=psr2

@ThaDafinser
Copy link
Contributor Author

@turrsis is the failing because of the formatting? Oo

@ThaDafinser
Copy link
Contributor Author

Ahhh better =)

@ThaDafinser
Copy link
Contributor Author

@turrsis thanks for the hint...

There are still unresolved issues for testing under windows, but many are fixed with this PR

@@ -72,7 +72,9 @@ public function testSaveXmlOutputsXmlStringForEntry()
file_get_contents($this->feedSamplePath.'/atom.xml')
);
$entry = $feed->current();
$this->assertEquals($entry->saveXml(), file_get_contents($this->feedSamplePath.'/atom_rewrittenbydom.xml'));
$expected = file_get_contents($this->feedSamplePath.'/atom_rewrittenbydom.xml');
Copy link
Member

Choose a reason for hiding this comment

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

what about DIRECTORY_SEPARATOR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

PHP handles paths converting itself. The DIRECTORY_SEPERATOR is only needed when it comes to comparison.

@turrsis
Copy link
Contributor

turrsis commented Oct 29, 2013

Nothing of this is not resolve the problems.
ZendTest/Feed/, ZendTest/Db/, ZendTest/Crypt/, ZendTest/Config/ is already ok - no changes need.
ZendTest\Console\Prompt\NumberTest::testCanReadNumberOnMultilign - is failed.

@ThaDafinser To my mind - you should check CrLf settings for your git.

@turrsis
Copy link
Contributor

turrsis commented Oct 29, 2013

@ThaDafinser Comments on @Maks3w still actual.

@ThaDafinser
Copy link
Contributor Author

@turrsis i'm really sorry, but i have a lot of problems understanding your sentences.
What do you mean with "Nothing of this is not resolve the problems." - Do ALL problems still exist for you? Or are there still other issues? Because i have not fixed the complete testing suite.

What is with the comments from @Maks3w ? Do you have problems with '/' for file loading in your ENV? It should be only a problem when it comes to comparison

The EOL in my ENV is \r\n (but that should be fixed by the php-cs-fixer or not?)

@turrsis
Copy link
Contributor

turrsis commented Oct 29, 2013

@ThaDafinser try to revert you changes, change CrLf settings for your git, clone zf2 again to new folder, run tests - ZendTest/Feed/, ZendTest/Db/, ZendTest/Crypt/, ZendTest/Config/ will ok. See comments on #5163

weierophinney added a commit that referenced this pull request Oct 30, 2013
weierophinney added a commit that referenced this pull request Oct 30, 2013
@ghost ghost assigned weierophinney Oct 30, 2013
@turrsis
Copy link
Contributor

turrsis commented Oct 31, 2013

Sorry - my previous comment is realy hard for undertanding.

  1. psr-2 - All PHP files MUST use the Unix LF (linefeed) line ending.
  2. to my mind - using str_replace("\r\n", "\n", $expected); is not good practic because in ZendTest many tests failed for Windows #5163 using 50 replacements and this not solve all problems.
    After Ocramius's comment (ZendTest many tests failed for Windows #5163 (comment)) i reload repository with correct Unix LineFeed - and most problem with EOL was resolved.
  3. ZendTest\Crypt\Key\Derivation\ScryptTest is failed on Windows when Unix LF is using

weierophinney added a commit to zendframework/zend-config that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-config that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-config that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-crypt that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-crypt that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-crypt that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-console that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-console that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-console that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-filter that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-filter that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-filter that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-soap that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-soap that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-soap that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-feed that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-feed that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-feed that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants