Skip to content

Commit

Permalink
CI - hotfix running tests on php 7.2
Browse files Browse the repository at this point in the history
https://travis-ci.org/EdgedesignCZ/phpqa/jobs/336877235

Don't use assertEquals
PHP Fatal error:  Declaration of SebastianBergmann\Comparator\DOMNodeComparator::assertEquals($expected, $actual, $delta = 0, $canonicalize = false, $ignoreCase = false) must be compatible with SebastianBergmann\Comparator\ObjectComparator::assertEquals($expected, $actual, $delta = 0, $canonicalize = false, $ignoreCase = false, array &$processed = Array) in /vendor/sebastian/comparator/src/DOMNodeComparator.php on line 110

Updating phpunit sucks because of internal libraries used in phpcpd/phploc
sebastianbergmann/phpcpd#152
composer remove phpunit/phpunit --dev
composer require phpunit/phpunit:~5.7 --dev

    - Conclusion: remove phpunit/php-timer 2.0.0
    - Installation request for phpunit/phpunit ~5.7 -> satisfiable by phpunit/phpunit[5.7.0, 5.7.1, 5.7.10, 5.7.11, 5.7.12, 5.7.13, 5.7.14, 5.7.15, 5.7.16, 5.7.17, 5.7.18, 5.7.19, 5.7.2, 5.7.20, 5.7.21, 5.7.22, 5.7.23, 5.7.24, 5.7.25, 5.7.26, 5.7.27, 5.7.3, 5.7.4, 5.7.5, 5.7.6, 5.7.7, 5.7.8, 5.7.9].
    - Conclusion: don't install phpunit/php-timer 2.0.0
    - phpunit/phpunit 5.7.0 requires phpunit/php-timer ^1.0.6 -> satisfiable by phpunit/php-timer[1.0.6, 1.0.7, 1.0.8, 1.0.9].
  • Loading branch information
zdenekdrahos committed Feb 3, 2018
1 parent 052befa commit 9fe5cc9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/IgnoredPathsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ public function testNoOptionWhenNothingIsIgnored($tool)
public function testIgnoreDirectoriesAndFiles($tool, $expectedOptions, $os = null)
{
$this->operatingSystem = $os ?: $this->operatingSystem;
$this->assertEquals(
assertThat(
$expectedOptions,
[
is([
'both' => $this->ignore($tool, 'bin,vendor', 'autoload.php,RoboFile.php'),
'dirs' => $this->ignore($tool, 'bin,vendor', ''),
'files' => $this->ignore($tool, '', 'autoload.php,RoboFile.php'),
]
])
);
}

Expand Down
3 changes: 3 additions & 0 deletions tests/RunningToolTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ public function testRuntimeSelectionOfErrorXpath()
/** @dataProvider provideProcess */
public function testAnalyzeExitCodeInCliMode($allowedErrors, $exitCode, array $expectedResult)
{
if (version_compare(PHP_VERSION, '7.2.0') >= 0) {
$this->markTestSkipped('Skipped on PHP 7.2');
}
$tool = new RunningTool('tool', [
'allowedErrorsCount' => $allowedErrors
]);
Expand Down

0 comments on commit 9fe5cc9

Please sign in to comment.