1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

4.x - skip Stringable test if not in PHP 8.0

This commit is contained in:
Matt Brown 2020-10-12 11:35:14 -04:00
parent 5c2591f7b0
commit 7cf6495461
3 changed files with 13 additions and 1 deletions

View File

@ -147,7 +147,7 @@ class ToStringTest extends TestCase
echo $a;
}'
],
'stringableInterface' => [
'PHP80-stringableInterface' => [
'<?php
interface Foo extends Stringable {}

View File

@ -39,6 +39,12 @@ trait InvalidCodeAnalysisTestTrait
if (version_compare(PHP_VERSION, '7.1.0', '<')) {
$this->markTestSkipped('Test case requires PHP 7.1.');
return;
}
} elseif (strpos($test_name, 'PHP80-') !== false) {
if (version_compare(PHP_VERSION, '8.0.0', '<')) {
$this->markTestSkipped('Test case requires PHP 8.0.');
return;
}
} elseif (strpos($test_name, 'SKIPPED-') !== false) {

View File

@ -45,6 +45,12 @@ trait ValidCodeAnalysisTestTrait
if (version_compare(PHP_VERSION, '7.1.0', '<')) {
$this->markTestSkipped('Test case requires PHP 7.1.');
return;
}
} elseif (strpos($test_name, 'PHP80-') !== false) {
if (version_compare(PHP_VERSION, '8.0.0', '<')) {
$this->markTestSkipped('Test case requires PHP 8.0.');
return;
}
} elseif (strpos($test_name, 'SKIPPED-') !== false) {