File tree Expand file tree Collapse file tree 1 file changed +18
-16
lines changed
Expand file tree Collapse file tree 1 file changed +18
-16
lines changed Original file line number Diff line number Diff line change 77use PHPUnit \Framework \TestCase ;
88use Yiisoft \Html \Attribute \Deprecated ;
99
10+ use const E_USER_DEPRECATED ;
11+
1012final class DeprecatedTest extends TestCase
1113{
12- private function make (?string $ message , ?string $ since ): Deprecated
13- {
14- $ errors = [];
15- set_error_handler (static function (int $ errno , string $ errstr ) use (&$ errors ): bool {
16- $ errors [] = $ errstr ;
17- return true ;
18- }, E_USER_DEPRECATED );
19-
20- $ attribute = new Deprecated ($ message , $ since );
21-
22- restore_error_handler ();
23-
24- return $ attribute ;
25- }
26-
2714 public function testMessageProperty (): void
2815 {
2916 $ attribute = $ this ->make ('Test message ' , null );
@@ -95,4 +82,19 @@ public function testClassAlias(): void
9582
9683 $ this ->assertInstanceOf (Deprecated::class, $ attribute );
9784 }
98- }
85+
86+ private function make (?string $ message , ?string $ since ): Deprecated
87+ {
88+ $ errors = [];
89+ set_error_handler (static function (int $ errno , string $ errstr ) use (&$ errors ): bool {
90+ $ errors [] = $ errstr ;
91+ return true ;
92+ }, E_USER_DEPRECATED );
93+
94+ $ attribute = new Deprecated ($ message , $ since );
95+
96+ restore_error_handler ();
97+
98+ return $ attribute ;
99+ }
100+ }
You can’t perform that action at this time.
0 commit comments