File: 0002-Drop-tests-breaking-under-PHPUnit-11.patch

package info (click to toggle)
php-league-commonmark 2.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,536 kB
  • sloc: php: 20,636; xml: 1,998; ruby: 45; makefile: 21; javascript: 15
file content (287 lines) | stat: -rw-r--r-- 10,117 bytes parent folder | download | duplicates (2)
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
From: =?utf-8?q?David_Pr=C3=A9vot?= <david@tilapin.org>
Date: Tue, 6 Feb 2024 19:21:40 +0100
Subject: Drop tests breaking under PHPUnit 11

---
 tests/functional/CMarkRegressionTest.php           | 41 ----------------
 tests/functional/CommonMarkJSRegressionTest.php    | 30 ------------
 .../GithubFlavoredMarkdownExtensionTest.php        | 43 -----------------
 .../SmartPunct/SmartPunctFunctionalTest.php        | 56 ----------------------
 tests/functional/SpecTest.php                      | 32 -------------
 .../Data/SymfonyYamlFrontMatterParserTest.php      | 26 ----------
 6 files changed, 228 deletions(-)
 delete mode 100644 tests/functional/CMarkRegressionTest.php
 delete mode 100644 tests/functional/CommonMarkJSRegressionTest.php
 delete mode 100644 tests/functional/Extension/GithubFlavoredMarkdownExtensionTest.php
 delete mode 100644 tests/functional/Extension/SmartPunct/SmartPunctFunctionalTest.php
 delete mode 100644 tests/functional/SpecTest.php

diff --git a/tests/functional/CMarkRegressionTest.php b/tests/functional/CMarkRegressionTest.php
deleted file mode 100644
index ec93cc4..0000000
--- a/tests/functional/CMarkRegressionTest.php
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/*
- * This file is part of the league/commonmark package.
- *
- * (c) Colin O'Dell <colinodell@gmail.com>
- *
- * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js)
- *  - (c) John MacFarlane
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace League\CommonMark\Tests\Functional;
-
-use League\CommonMark\Util\SpecReader;
-
-/**
- * Tests the parser against the CommonMark spec
- */
-final class CMarkRegressionTest extends AbstractSpecTestCase
-{
-    public static function dataProvider(): \Generator
-    {
-        self::markTestSkipped('Dependency not packaged (yet).');
-
-        $tests = SpecReader::readFile(__DIR__ . '/../../vendor/commonmark/cmark/test/regression.txt');
-        foreach ($tests as $example) {
-            // The case-fold test from example 21 fails on PHP 8.0.* and below due to the behavior of mb_convert_case().
-            // See https://3v4l.org/7TeXJ.
-            if (\PHP_VERSION_ID < 81000 && $example['number'] === 21) {
-                continue;
-            }
-
-            yield $example;
-        }
-    }
-}
diff --git a/tests/functional/CommonMarkJSRegressionTest.php b/tests/functional/CommonMarkJSRegressionTest.php
deleted file mode 100644
index ce58efd..0000000
--- a/tests/functional/CommonMarkJSRegressionTest.php
+++ /dev/null
@@ -1,30 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/*
- * This file is part of the league/commonmark package.
- *
- * (c) Colin O'Dell <colinodell@gmail.com>
- *
- * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js)
- *  - (c) John MacFarlane
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace League\CommonMark\Tests\Functional;
-
-use League\CommonMark\Util\SpecReader;
-
-/**
- * Tests the parser against the CommonMark spec
- */
-final class CommonMarkJSRegressionTest extends AbstractSpecTestCase
-{
-    public static function dataProvider(): \Generator
-    {
-        yield from SpecReader::readFile(__DIR__ . '/../../vendor/commonmark/commonmark.js/test/regression.txt');
-    }
-}
diff --git a/tests/functional/Extension/GithubFlavoredMarkdownExtensionTest.php b/tests/functional/Extension/GithubFlavoredMarkdownExtensionTest.php
deleted file mode 100644
index c51087e..0000000
--- a/tests/functional/Extension/GithubFlavoredMarkdownExtensionTest.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/*
- * This file is part of the league/commonmark package.
- *
- * (c) Colin O'Dell <colinodell@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace League\CommonMark\Tests\Functional\Extension;
-
-use League\CommonMark\GithubFlavoredMarkdownConverter;
-use League\CommonMark\Tests\Functional\AbstractSpecTestCase;
-use League\CommonMark\Util\SpecReader;
-
-final class GithubFlavoredMarkdownExtensionTest extends AbstractSpecTestCase
-{
-    protected function setUp(): void
-    {
-        $this->converter = new GithubFlavoredMarkdownConverter();
-    }
-
-    public static function dataProvider(): \Generator
-    {
-        self::markTestSkipped('Dependency not packaged (yet).');
-
-        $tests = SpecReader::readFile(__DIR__ . '/../../../vendor/github/gfm/test/spec.txt');
-
-        foreach ($tests as $title => $data) {
-            // In the GFM spec, standard CommonMark tests are tagged 'example'
-            // and we don't want to test those (because we test those against the
-            // official CommonMark spec), but we DO want to test the GFM-specific ones
-            // which will be tagged something like 'example autolink'
-            if ($data['type'] !== 'example') {
-                yield $title => $data;
-            }
-        }
-    }
-}
diff --git a/tests/functional/Extension/SmartPunct/SmartPunctFunctionalTest.php b/tests/functional/Extension/SmartPunct/SmartPunctFunctionalTest.php
deleted file mode 100644
index cca9cb1..0000000
--- a/tests/functional/Extension/SmartPunct/SmartPunctFunctionalTest.php
+++ /dev/null
@@ -1,56 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/*
- * This file is part of the league/commonmark package.
- *
- * (c) Colin O'Dell <colinodell@gmail.com>
- *
- * Original code based on the CommonMark JS reference parser (http://bitly.com/commonmark-js)
- *  - (c) John MacFarlane
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace League\CommonMark\Tests\Functional\Extension\SmartPunct;
-
-use League\CommonMark\Environment\Environment;
-use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension;
-use League\CommonMark\Extension\SmartPunct\SmartPunctExtension;
-use League\CommonMark\MarkdownConverter;
-use League\CommonMark\Tests\Functional\AbstractSpecTestCase;
-use League\CommonMark\Util\SpecReader;
-
-/**
- * Tests the parser against the CommonMark spec
- */
-final class SmartPunctFunctionalTest extends AbstractSpecTestCase
-{
-    protected function setUp(): void
-    {
-        $environment = new Environment();
-        $environment->addExtension(new CommonMarkCoreExtension());
-        $environment->addExtension(new SmartPunctExtension());
-
-        $this->converter = new MarkdownConverter($environment);
-    }
-
-    public static function dataProvider(): \Generator
-    {
-        self::markTestSkipped('Dependency not packaged (yet).');
-
-        yield from SpecReader::readFile(__DIR__ . '/../../../../vendor/commonmark/commonmark.js/test/smart_punct.txt');
-
-        yield 'Existing formatted quotes should be preserved (issue #1030)' => [
-            'input'   => 'In the middle to late ’90s, it was chaos. "We couldn\'t get out of that rut."',
-            'output'  => "<p>In the middle to late ’90s, it was chaos. “We couldn’t get out of that rut.”</p>\n",
-        ];
-
-        yield 'already-formatted quotes are kept as-is' => [
-            'input'   => '"Plain quotes", “normal quotes”, and ”backwards quotes“',
-            'output'  => "<p>“Plain quotes”, “normal quotes”, and ”backwards quotes“</p>\n",
-        ];
-    }
-}
diff --git a/tests/functional/SpecTest.php b/tests/functional/SpecTest.php
deleted file mode 100644
index a3a05bc..0000000
--- a/tests/functional/SpecTest.php
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/*
- * This file is part of the league/commonmark package.
- *
- * (c) Colin O'Dell <colinodell@gmail.com>
- *
- * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js)
- *  - (c) John MacFarlane
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace League\CommonMark\Tests\Functional;
-
-use League\CommonMark\Util\SpecReader;
-
-/**
- * Tests the parser against the CommonMark spec
- */
-final class SpecTest extends AbstractSpecTestCase
-{
-    public static function dataProvider(): \Generator
-    {
-        self::markTestSkipped('Dependency not packaged (yet).');
-
-        yield from SpecReader::readFile(__DIR__ . '/../../vendor/commonmark/commonmark.js/test/spec.txt');
-    }
-}
diff --git a/tests/unit/Extension/FrontMatter/Data/SymfonyYamlFrontMatterParserTest.php b/tests/unit/Extension/FrontMatter/Data/SymfonyYamlFrontMatterParserTest.php
index 2e9a4fd..73ea6a2 100644
--- a/tests/unit/Extension/FrontMatter/Data/SymfonyYamlFrontMatterParserTest.php
+++ b/tests/unit/Extension/FrontMatter/Data/SymfonyYamlFrontMatterParserTest.php
@@ -42,32 +42,6 @@ final class SymfonyYamlFrontMatterParserTest extends TestCase
         yield ["foo: bar\nbaz: 42", ['foo' => 'bar', 'baz' => 42]];
     }
 
-    /**
-     * @dataProvider provideInvalidYamlExamples
-     */
-    public function testParseWithInvalidYaml(string $input): void
-    {
-        $this->expectException(InvalidFrontMatterException::class);
-
-        $dataParser = new SymfonyYamlFrontMatterParser();
-
-        $dataParser->parse($input);
-    }
-
-    /**
-     * @return iterable<string>
-     */
-    public static function provideInvalidYamlExamples(): iterable
-    {
-        self::markTestSkipped('Dependency not packaged (yet).');
-
-        yield ["this:\n    is:invalid\n        yaml: data"];
-
-        if (! self::yamlLibrarySupportsObjectUnserialization()) {
-            yield ['foo: !php/object:O:30:"Symfony\Tests\Component\Yaml\B":1:{s:1:"b";s:3:"foo";}'];
-        }
-    }
-
     private static function yamlLibrarySupportsObjectUnserialization(): bool
     {
         $fullVersion = InstalledComposerPackages::getVersion('symfony/yaml');