-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix tests. #24
Fix tests. #24
Conversation
@keradus |
.travis.yml
Outdated
@@ -82,8 +82,7 @@ script: | |||
- if [ $TASK_TESTS == 1 ] && [ $TASK_TESTS_COVERAGE == 0 ]; then vendor/bin/phpunit --verbose; fi | |||
- if [ $TASK_TESTS == 1 ] && [ $TASK_TESTS_COVERAGE == 1 ]; then phpdbg -qrr vendor/bin/phpunit --verbose --coverage-clover build/logs/clover.xml; fi | |||
|
|||
- if [ $TASK_SCA == 1 ]; then git checkout . -q; fi | |||
|
|||
- if [ $TASK_CS == 1 ]; then git checkout . -q; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this change? if no SCA was performed, there is no files to checkout, isn't it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yes, this change is not good
.travis.yml
Outdated
@@ -21,7 +21,7 @@ matrix: | |||
- php: 7.1 | |||
env: TASK_SCA=1 | |||
- php: nightly | |||
env: TASK_SCA=1 COMPOSER_FLAGS="--ignore-platform-reqs" | |||
env: COMPOSER_FLAGS="--ignore-platform-reqs" TASK_CS=0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what I was thinking actually was introduction of new ENV flag:
PHP_CS_FIXER_IGNORE_ENV=1
and allow tool to run on 7.2 with that flag.
For that, we would be able to run the SCA/CS tasks
tests/ConfigTest.php
Outdated
@@ -107,7 +107,7 @@ public function testThatFinderWorksWithDirSetOnConfig() | |||
$config = new Config(); | |||
|
|||
$iterator = $config->getFinder()->in(__DIR__.'/Fixtures/FinderDirectory')->getIterator(); | |||
$this->assertSame(1, count($iterator)); | |||
$this->assertSame(1, iterator_count($iterator)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting, do you have an ref for that change ?
would assertCount
finally works ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assertCount
will work I think, however we might run in the old HHVM bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, my question is more like "is there a hhvm version that has fixed that bug already" :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so, it still not working on hhvm :/
why calling |
Indeed, calling This fails for |
My guess is https://3v4l.org/ZjdMV i.e. something like HHVM and RecursiveRegexIterator for ref.: facebook/hhvm#4966 |
a24c8a4
to
476405d
Compare
@@ -133,7 +133,7 @@ public function testThatCustomSymfonyFinderWorks() | |||
$config = Config::create()->setFinder($finder); | |||
|
|||
$iterator = $config->getFinder()->getIterator(); | |||
$this->assertSame(1, count($iterator)); | |||
$this->assertCount(1, $iterator); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SpacePossum , fix to make it working properly on hhvm is to run iterator_to_array($iterator)
first :/
still, even hhvm 3.18 is not fixed that bug... what a shame for hhvm...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah :(
Wonder if HHVM is not hit by same bug as PHP was;
https://github.com/symfony/symfony/blob/2.8/src/Symfony/Component/Finder/Iterator/FilterIterator.php#L32
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wooow, so great :/
@SpacePossum , could you review it please: PHP-CS-Fixer#2552 ? |
somehow the PHP check of the fixer itself must be bypassed (https://travis-ci.org/keradus/PHP-CS-Fixer/jobs/203770470#L292) or it should not run as phar on the 7.2/nightly test suit.