Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Jul 20, 2022
1 parent 2e6e614 commit 220b57c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
1 change: 0 additions & 1 deletion tests/PHPStan/Analyser/NodeScopeResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,6 @@ public function dataFileAsserts(): iterable
yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-7663-php8.php');
}
yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-7663.php');

}

/**
Expand Down
8 changes: 5 additions & 3 deletions tests/PHPStan/Analyser/data/bug-7663-php7.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
class HelloWorld7
{
/**
* @param 'de_DE'|'en_US' $language
* @param 'de_DE'|'pretty-long' $str
*/
public function sayHello($language): void
public function sayHello($str): void
{
assertType("false", substr('de_DE', 10, -10));
assertType("false", substr('de_DE', 5, -5));
assertType("'y'", substr('pretty-long', 5, -5));
assertType("'y'|false", substr($str, 5, -5));
}
}
8 changes: 5 additions & 3 deletions tests/PHPStan/Analyser/data/bug-7663-php8.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
class HelloWorld8
{
/**
* @param 'de_DE'|'en_US' $language
* @param 'de_DE'|'pretty-long' $str
*/
public function sayHello($language): void
public function sayHello($str): void
{
assertType("''", substr('de_DE', 10, -10));
assertType("''", substr('de_DE', 5, -5));
assertType("'y'", substr('pretty-long', 5, -5));
assertType("''|'y'", substr($str, 5, -5));
}
}

0 comments on commit 220b57c

Please sign in to comment.