Skip to content

Commit 4665ed2

Browse files
committed
Fix a testcase to test the compatibility check works for a case of unrelated traits and a case without overriding in the compising class
1 parent 20f991c commit 4665ed2

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

Zend/tests/traits/constant_002.phpt

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ trait TestTrait1 {
88
}
99

1010
trait TestTrait2 {
11-
use TestTrait1;
1211
public const A = 42;
1312
}
1413

@@ -17,13 +16,26 @@ trait TestTrait3 {
1716
public const A = 42;
1817
}
1918

20-
class ComposingClass {
19+
class ComposingClass1 {
20+
use TestTrait1;
21+
use TestTrait2;
22+
}
23+
24+
class ComposingClass2 {
25+
use TestTrait1;
26+
use TestTrait3;
27+
}
28+
29+
class ComposingClass3 {
2130
use TestTrait1;
2231
use TestTrait3;
2332
public const A = 42;
2433
}
2534

26-
echo ComposingClass::A, PHP_EOL;
35+
echo ComposingClass1::A, PHP_EOL;
36+
echo ComposingClass2::A, PHP_EOL;
37+
echo ComposingClass3::A, PHP_EOL;
2738
?>
2839
--EXPECTF--
2940
42
41+
42

0 commit comments

Comments
 (0)