Skip to content

Commit 2a0ee43

Browse files
committed
added test
1 parent f49fb32 commit 2a0ee43

File tree

5 files changed

+26
-0
lines changed

5 files changed

+26
-0
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,10 @@ jobs:
296296
- script: |
297297
cd e2e/bug-11819
298298
../../bin/phpstan
299+
- script: |
300+
cd e2e/composer-and-phpstan-version-config
301+
composer install --ignore-platform-reqs
302+
../../bin/phpstan analyze test.php --level=0
299303
- script: |
300304
cd e2e/composer-max-version
301305
composer install
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/vendor/
2+
composer.lock
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"require": {
3+
"php": "^7.0"
4+
}
5+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
parameters:
2+
phpVersion:
3+
min: 80103
4+
max: 80304
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
// constraint from composer.json is overruled by phpstan.neon config
4+
\PHPStan\Testing\assertType('int<80103, 80304>', PHP_VERSION_ID);
5+
\PHPStan\Testing\assertType('8', PHP_MAJOR_VERSION);
6+
\PHPStan\Testing\assertType('int<1, 3>', PHP_MINOR_VERSION);
7+
\PHPStan\Testing\assertType('int<0, max>', PHP_RELEASE_VERSION);
8+
9+
\PHPStan\Testing\assertType('1', version_compare(PHP_VERSION, '7.0.0'));
10+
\PHPStan\Testing\assertType('false', version_compare(PHP_VERSION, '7.0.0', '<'));
11+
\PHPStan\Testing\assertType('true', version_compare(PHP_VERSION, '7.0.0', '>'));

0 commit comments

Comments
 (0)