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

Fix tests. #24

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ matrix:
env: DEPLOY=yes TASK_TESTS_COVERAGE=1
- php: 7.1
env: TASK_SCA=1
- php: nightly
env: COMPOSER_FLAGS="--ignore-platform-reqs" TASK_CS=0
Copy link
Owner

@keradus keradus Feb 27, 2017

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

- php: 5.3
env: SKIP_LINT_TEST_CASES=1 COMPOSER_FLAGS="--prefer-stable --prefer-lowest"
- php: 5.4
Expand Down Expand Up @@ -80,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
Copy link
Owner

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 ?

Copy link
Author

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

- if [ $TASK_CS == 1 ]; then php php-cs-fixer --diff --dry-run -v fix; fi

after_success:
Expand Down
6 changes: 3 additions & 3 deletions tests/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Copy link
Owner

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 ?

Copy link
Author

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

Copy link
Owner

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

Copy link
Owner

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 :/

$iterator->rewind();
$this->assertSame('somefile.php', $iterator->current()->getFilename());
}
Expand All @@ -120,7 +120,7 @@ public function testThatCustomFinderWorks()
$config = Config::create()->setFinder($finder);

$iterator = $config->getFinder()->getIterator();
$this->assertSame(1, count($iterator));
$this->assertSame(1, iterator_count($iterator));
$iterator->rewind();
$this->assertSame('somefile.php', $iterator->current()->getFilename());
}
Expand All @@ -133,7 +133,7 @@ public function testThatCustomSymfonyFinderWorks()
$config = Config::create()->setFinder($finder);

$iterator = $config->getFinder()->getIterator();
$this->assertSame(1, count($iterator));
$this->assertSame(1, iterator_count($iterator));
$iterator->rewind();
$this->assertSame('somefile.php', $iterator->current()->getFilename());
}
Expand Down