File tree Expand file tree Collapse file tree 2 files changed +43
-4
lines changed
tests/end-to-end/regression Expand file tree Collapse file tree 2 files changed +43
-4
lines changed Original file line number Diff line number Diff line change @@ -14,14 +14,28 @@ PHPUnit %s by Sebastian Bergmann and contributors.
14
14
15
15
Runtime: %s
16
16
17
- .D. 3 / 3 (100 %)
17
+ .D.DD 5 / 5 (100 %)
18
18
19
19
Time: %s, Memory: %s
20
20
21
- 1 test triggered 1 deprecation :
21
+ 3 tests triggered 3 deprecations :
22
22
23
- 1 ) %sTriggersDeprecationInDataProviderTest.php:24
23
+ 1 ) %sTriggersDeprecationInDataProviderTest.php:25
24
24
some deprecation
25
25
26
+ Triggered by:
27
+
28
+ * PHPUnit \TestFixture \Issue6279 \TriggersDeprecationInDataProviderTest::method2#0
29
+ %sTriggersDeprecationInDataProviderTest.php:38
30
+
31
+ * PHPUnit \TestFixture \Issue6279 \TriggersDeprecationInDataProviderTest::method4#0
32
+ %sTriggersDeprecationInDataProviderTest.php:51
33
+
34
+ 2 ) %sTriggersDeprecationInDataProviderTest.php:65
35
+ first
36
+
37
+ 3 ) %sTriggersDeprecationInDataProviderTest.php:66
38
+ second
39
+
26
40
OK , but there were issues!
27
- Tests: 3 , Assertions: 3 , Deprecations: 1 .
41
+ Tests: 5 , Assertions: 5 , Deprecations: 3 .
Original file line number Diff line number Diff line change 12
12
namespace PHPUnit \TestFixture \Issue6279 ;
13
13
14
14
use const E_USER_DEPRECATED ;
15
+ use const E_USER_WARNING ;
15
16
use function trigger_error ;
16
17
use PHPUnit \Framework \Attributes \DataProvider ;
18
+ use PHPUnit \Framework \Attributes \DataProviderExternal ;
17
19
use PHPUnit \Framework \Attributes \Test ;
18
20
use PHPUnit \Framework \TestCase ;
19
21
@@ -26,6 +28,15 @@ public static function dataProvider(): iterable
26
28
yield [true ];
27
29
}
28
30
31
+ public static function dataWith2Deprecations (): iterable
32
+ {
33
+ @trigger_error ('first ' , E_USER_DEPRECATED );
34
+ @trigger_error ('second ' , E_USER_DEPRECATED );
35
+ @trigger_error ('warning ' , E_USER_WARNING );
36
+
37
+ yield [true ];
38
+ }
39
+
29
40
#[Test]
30
41
public function method1 (): void
31
42
{
@@ -44,4 +55,18 @@ public function method3(): void
44
55
{
45
56
$ this ->assertTrue (true );
46
57
}
58
+
59
+ #[Test]
60
+ #[DataProvider('dataProvider ' )]
61
+ public function method4 (bool $ value ): void
62
+ {
63
+ $ this ->assertTrue ($ value );
64
+ }
65
+
66
+ #[Test]
67
+ #[DataProviderExternal(self ::class, 'dataWith2Deprecations ' )]
68
+ public function method5 (bool $ value ): void
69
+ {
70
+ $ this ->assertTrue ($ value );
71
+ }
47
72
}
You can’t perform that action at this time.
0 commit comments