Skip to content

Commit

Permalink
Test cases for DuplicateProperty issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tuqqu committed Oct 8, 2023
1 parent 35d48c0 commit 77d7c94
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tests/ClassTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1436,6 +1436,39 @@ class BazClass implements InterFaceA, InterFaceB {}
'error_message' => 'InheritorViolation',
'ignored_issues' => [],
],
'duplicateInstanceProperties' => [
'code' => <<<'PHP'
<?php
class Foo {
public mixed $bar;
public int $bar;
}
PHP,
'error_message' => 'DuplicateProperty',
'ignored_issues' => [],
],
'duplicateStaticProperties' => [
'code' => <<<'PHP'
<?php
class Foo {
public static mixed $bar = null;
public static string $bar = 'bar';
}
PHP,
'error_message' => 'DuplicateProperty',
'ignored_issues' => [],
],
'duplicateMixedProperties' => [
'code' => <<<'PHP'
<?php
class Foo {
public bool $bar = true;
public static bool $bar = false;
}
PHP,
'error_message' => 'DuplicateProperty',
'ignored_issues' => [],
],
];
}
}

0 comments on commit 77d7c94

Please sign in to comment.