@@ -66,15 +66,25 @@ public function testSilencedNotice(): void
6666
6767 public function testWarning (): void
6868 {
69- // foreach() argument must be of type array|object.
70- foreach (1 as $ n ) {}
69+ $ this ->triggerWarning ();
7170
7271 self ::assertTrue (true );
7372 }
7473
7574 public function testSilencedWarning (): void
7675 {
77- $ foo = @$ bar ;
76+ $ foo = @$ this ->triggerWarning ();
77+
78+ self ::assertTrue (true );
79+ }
80+
81+ public function testWarningDuplicates (): void
82+ {
83+ $ this ->triggerWarning ();
84+ $ this ->triggerWarning ();
85+ $ this ->triggerWarning ();
86+
87+ foreach (1 as $ n ) {}
7888
7989 self ::assertTrue (true );
8090 }
@@ -98,55 +108,18 @@ public function testSilencedDeprecation(): void
98108 self ::assertTrue (true );
99109 }
100110
101- private function triggerWarning (): void
102- {
103- foreach (1 as $ n ) {}
104- }
105-
106- public function testDuplicateWarningsA (): void
107- {
108- $ this ->triggerWarning ();
109-
110- self ::assertTrue (true );
111- }
112-
113- public function testDuplicateWarningsB (): void
114- {
115- $ this ->triggerWarning ();
116- $ this ->triggerWarning ();
117- $ this ->triggerWarning ();
118-
119- foreach (1 as $ n ) {}
120-
121- self ::assertTrue (true );
122- }
123-
124- public function testDuplicateWarningsC (): void
125- {
126- self ::assertTrue (true );
127- }
128-
129111 public function testMixedSeverities (): void
130112 {
131113 // Notice.
132114 $ foo = &self ::provideData ();
115+ // Warning.
133116 $ this ->triggerWarning ();
134- // Deprecated .
117+ // Deprecation .
135118 trim (null );
136119
137120 self ::assertTrue (true );
138121 }
139122
140- public function testSilencedWarningNotAffectsStatus (): void
141- {
142- @$ this ->triggerWarning ();
143-
144- // Notice.
145- $ foo = &self ::provideData ();
146-
147- self ::assertTrue (true );
148- }
149-
150123 #[DataProvider('provideData ' )]
151124
152125 public function testDataProvider (): void
@@ -188,4 +161,10 @@ public function testGigaSlow(): void
188161
189162 self ::assertTrue (true );
190163 }
164+
165+ private function triggerWarning (): void
166+ {
167+ // foreach() argument must be of type array|object.
168+ foreach (1 as $ n ) {}
169+ }
191170}
0 commit comments