Skip to content

Commit

Permalink
ParserTest: Explicitly check for undefined nullable properties
Browse files Browse the repository at this point in the history
  • Loading branch information
jnvsor committed Jul 18, 2024
1 parent 7e7770a commit 19b1683
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/Fixtures/Php74TestClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@ class Php74TestClass
public $d;
public ?string $e = null;
public $f = null;
public ?string $g;
protected $prot_a = 1;
protected string $prot_b = '2';
protected string $prot_c;
protected $prot_d;
protected ?string $prot_e = null;
protected $prot_f = null;
protected ?string $prot_g;
private $priv_a = 1;
private string $priv_b = '2';
private string $priv_c;
private $priv_d;
private ?string $priv_e = null;
private $priv_f = null;
private ?string $priv_g;
}
3 changes: 3 additions & 0 deletions tests/Parser/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,11 @@ function (&$var, &$o) use (&$pluginCount) {

$expected = [
['c', 'undefined', '$v->c'],
['g', 'undefined', '$v->g'],
['prot_c', 'undefined', false],
['prot_g', 'undefined', false],
['priv_c', 'undefined', false],
['priv_g', 'undefined', false],
['a', 'integer', '$v->a'],
['b', 'string', '$v->b'],
['d', 'null', '$v->d'],
Expand Down

0 comments on commit 19b1683

Please sign in to comment.