Skip to content

Commit 5d2ea0a

Browse files
committed
test: split test cases for getenv
1 parent 2149f01 commit 5d2ea0a

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

tests/PHPStan/Analyser/nsrt/bug-4538.php renamed to tests/PHPStan/Analyser/nsrt/bug-4538-php7.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?php
1+
<?php // lint < 8.0
22

33
namespace Bug4538;
44

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php // lint >= 8.0
2+
3+
namespace Bug4538;
4+
5+
use function PHPStan\Testing\assertType;
6+
7+
class Foo
8+
{
9+
/**
10+
* @param string $index
11+
*/
12+
public function bar(string $index): void
13+
{
14+
assertType('string|array<string,string>|false', getenv($index));
15+
assertType('array<string, string>', getenv());
16+
assertType('array<string, string>', getenv(null));
17+
}
18+
}

0 commit comments

Comments
 (0)