Skip to content

Commit 211e0ee

Browse files
committed
Add test for deprecation messages coming from protected class constants
1 parent 15f670b commit 211e0ee

File tree

1 file changed

+22
-0
lines changed
  • Zend/tests/attributes/deprecated

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--TEST--
2+
#[\Deprecated]: Message from protected class constant.
3+
--FILE--
4+
<?php
5+
6+
class P {
7+
protected const DEPRECATION_MESSAGE = 'from class constant';
8+
}
9+
10+
class Clazz extends P {
11+
#[\Deprecated(parent::DEPRECATION_MESSAGE)]
12+
public function test() {
13+
14+
}
15+
}
16+
17+
$c = new Clazz();
18+
$c->test();
19+
20+
?>
21+
--EXPECTF--
22+
Deprecated: Method Clazz::test() is deprecated, from class constant in %s on line %d

0 commit comments

Comments
 (0)