Php unit windows #5369

Closed
wants to merge 11 commits into
from

Conversation

Projects
None yet
4 participants
@ThaDafinser
Contributor

ThaDafinser commented Oct 28, 2013

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 referenced this pull request Oct 28, 2013

Closed

ZendTest - Windows7 #5337

@turrsis

This comment has been minimized.

Show comment
Hide comment
@turrsis

turrsis Oct 28, 2013

Contributor

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

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

This comment has been minimized.

Show comment
Hide comment
@ThaDafinser

ThaDafinser Oct 28, 2013

Contributor

@turrsis is the failing because of the formatting? Oo

Contributor

ThaDafinser commented Oct 28, 2013

@turrsis is the failing because of the formatting? Oo

@ThaDafinser

This comment has been minimized.

Show comment
Hide comment
@ThaDafinser

ThaDafinser Oct 28, 2013

Contributor

Ahhh better =)

Contributor

ThaDafinser commented Oct 28, 2013

Ahhh better =)

@ThaDafinser

This comment has been minimized.

Show comment
Hide comment
@ThaDafinser

ThaDafinser Oct 28, 2013

Contributor

@turrsis thanks for the hint...

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

Contributor

ThaDafinser commented Oct 28, 2013

@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');

This comment has been minimized.

@Maks3w

Maks3w Oct 29, 2013

Member

what about DIRECTORY_SEPARATOR

@Maks3w

Maks3w Oct 29, 2013

Member

what about DIRECTORY_SEPARATOR

This comment has been minimized.

@ThaDafinser

ThaDafinser Oct 29, 2013

Contributor

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

@ThaDafinser

ThaDafinser Oct 29, 2013

Contributor

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

@@ -66,7 +66,9 @@ public function testSaveXmlOutputsXmlStringForFeed()
$feed = Reader\Reader::importString(
file_get_contents($this->feedSamplePath.'/atom.xml')
);
- $this->assertEquals($feed->saveXml(), file_get_contents($this->feedSamplePath.'/atom_rewrittenbydom.xml'));
+ $expected = file_get_contents($this->feedSamplePath.'/atom_rewrittenbydom.xml');

This comment has been minimized.

@Maks3w

Maks3w Oct 29, 2013

Member

here too

@Maks3w

Maks3w Oct 29, 2013

Member

here too

@turrsis

This comment has been minimized.

Show comment
Hide comment
@turrsis

turrsis Oct 29, 2013

Contributor

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.

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

This comment has been minimized.

Show comment
Hide comment
@turrsis

turrsis Oct 29, 2013

Contributor

@ThaDafinser Comments on @Maks3w still actual.

Contributor

turrsis commented Oct 29, 2013

@ThaDafinser Comments on @Maks3w still actual.

@ThaDafinser

This comment has been minimized.

Show comment
Hide comment
@ThaDafinser

ThaDafinser Oct 29, 2013

Contributor

@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?)

Contributor

ThaDafinser commented Oct 29, 2013

@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

This comment has been minimized.

Show comment
Hide comment
@turrsis

turrsis Oct 29, 2013

Contributor

@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 zendframework#5163

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 zendframework#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

This comment has been minimized.

Show comment
Hide comment
@turrsis

turrsis Oct 31, 2013

Contributor

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 zendframework#5163 using 50 replacements and this not solve all problems.
    After Ocramius's comment (zendframework#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
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 zendframework#5163 using 50 replacements and this not solve all problems.
    After Ocramius's comment (zendframework#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 join this conversation on GitHub. Already have an account? Sign in to comment