File: 0004-Modernize-PHPUnit-syntax.patch

package info (click to toggle)
php-masterminds-html5 2.10.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 824 kB
  • sloc: php: 9,678; makefile: 21
file content (113 lines) | stat: -rw-r--r-- 3,500 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit@debian.org>
Date: Fri, 28 Feb 2025 07:36:21 +0100
Subject: Modernize PHPUnit syntax

---
 test/HTML5/Html5Test.php                  |  5 ++---
 test/HTML5/Serializer/OutputRulesTest.php | 16 ++++++----------
 test/HTML5/Serializer/TraverserTest.php   |  5 ++---
 3 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/test/HTML5/Html5Test.php b/test/HTML5/Html5Test.php
index 0349209..859dcc6 100644
--- a/test/HTML5/Html5Test.php
+++ b/test/HTML5/Html5Test.php
@@ -3,6 +3,7 @@
 namespace Masterminds\HTML5\Tests;
 
 use Masterminds\HTML5;
+use PHPUnit\Framework\Attributes\Before;
 
 class Html5Test extends TestCase
 {
@@ -11,9 +12,7 @@ class Html5Test extends TestCase
      */
     private $html5;
 
-    /**
-     * @before
-     */
+    #[Before]
     public function before()
     {
         $this->html5 = $this->getInstance();
diff --git a/test/HTML5/Serializer/OutputRulesTest.php b/test/HTML5/Serializer/OutputRulesTest.php
index 30c6398..d824532 100644
--- a/test/HTML5/Serializer/OutputRulesTest.php
+++ b/test/HTML5/Serializer/OutputRulesTest.php
@@ -5,6 +5,8 @@ namespace Masterminds\HTML5\Tests\Serializer;
 use Masterminds\HTML5;
 use Masterminds\HTML5\Serializer\OutputRules;
 use Masterminds\HTML5\Serializer\Traverser;
+use PHPUnit\Framework\Attributes\Before;
+use PHPUnit\Framework\Attributes\DataProvider;
 
 class OutputRulesTest extends \Masterminds\HTML5\Tests\TestCase
 {
@@ -24,9 +26,7 @@ class OutputRulesTest extends \Masterminds\HTML5\Tests\TestCase
      */
     protected $html5;
 
-    /**
-     * @before
-     */
+    #[Before]
     public function before()
     {
         $this->html5 = $this->getInstance();
@@ -433,9 +433,8 @@ class OutputRulesTest extends \Masterminds\HTML5\Tests\TestCase
 
     /**
      * Test basic encoding of text.
-     *
-     * @dataProvider getEncData
      */
+    #[DataProvider('getEncData')]
     public function testEnc($isAttribute, $test, $expected, $expectedEncoded)
     {
         list($o, $s) = $this->getOutputRules();
@@ -452,9 +451,8 @@ class OutputRulesTest extends \Masterminds\HTML5\Tests\TestCase
 
     /**
      * Test basic encoding of text.
-     *
-     * @dataProvider getEncData
      */
+    #[DataProvider('getEncData')]
     public function testEscape($isAttribute, $test, $expected, $expectedEncoded)
     {
         list($o, $s) = $this->getOutputRules();
@@ -479,9 +477,7 @@ class OutputRulesTest extends \Masterminds\HTML5\Tests\TestCase
         );
     }
 
-    /**
-     * @dataProvider booleanAttributes
-     */
+    #[DataProvider('booleanAttributes')]
     public function testBooleanAttrs($html)
     {
         $dom = $this->html5->loadHTML('<!doctype html><html lang="en"><body>' . $html . '</body></html>');
diff --git a/test/HTML5/Serializer/TraverserTest.php b/test/HTML5/Serializer/TraverserTest.php
index 81dd444..d579a42 100644
--- a/test/HTML5/Serializer/TraverserTest.php
+++ b/test/HTML5/Serializer/TraverserTest.php
@@ -4,6 +4,7 @@ namespace Masterminds\HTML5\Tests\Serializer;
 
 use Masterminds\HTML5\Serializer\OutputRules;
 use Masterminds\HTML5\Serializer\Traverser;
+use PHPUnit\Framework\Attributes\Before;
 
 class TraverserTest extends \Masterminds\HTML5\Tests\TestCase
 {
@@ -18,9 +19,7 @@ class TraverserTest extends \Masterminds\HTML5\Tests\TestCase
       </body>
     </html>';
 
-    /**
-     * @before
-     */
+    #[Before]
     public function before()
     {
         $this->html5 = $this->getInstance();