Skip to content

Commit ef8663e

Browse files
committed
[BUGFIX] Solve Deprecations in unit tests
1 parent 08a9c91 commit ef8663e

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

packages/guides-restructured-text/tests/unit/Parser/Productions/AnnotationRuleTest.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public static function simpleNonAnnotationProvider(): array
7171
public function testAnnotationNodeFromLinesIterator(
7272
string $input,
7373
AnnotationListNode $node,
74-
string|null $nextLine = null,
74+
string|null $remaining = null,
7575
bool $nextLiteral = false,
7676
): void {
7777
$blockParser = $this->createContext($input);
@@ -83,7 +83,7 @@ public function testAnnotationNodeFromLinesIterator(
8383
$result,
8484
);
8585

86-
self::assertSame($nextLine, $blockParser->getDocumentIterator()->getNextLine());
86+
self::assertSame($remaining, $blockParser->getDocumentIterator()->getNextLine());
8787
self::assertSame($nextLiteral, $blockParser->getDocumentParserContext()->nextIndentedBlockShouldBeALiteralBlock);
8888
}
8989

@@ -93,27 +93,27 @@ public static function annotationProvider(): array
9393
return [
9494
'single line citation' => [
9595
'input' => '.. [name] Some Citation',
96-
'output' => new AnnotationListNode([new CitationNode([InlineCompoundNode::getPlainTextInlineNode('Some Citation')], 'name')], 'citation-list'),
96+
'node' => new AnnotationListNode([new CitationNode([InlineCompoundNode::getPlainTextInlineNode('Some Citation')], 'name')], 'citation-list'),
9797
],
9898
'single line Anonymous numbered footnote' => [
9999
'input' => '.. [#] Anonymous numbered footnote',
100-
'output' => new AnnotationListNode([new FootnoteNode([InlineCompoundNode::getPlainTextInlineNode('Anonymous numbered footnote')], '#', 0)], 'footer-list'),
100+
'node' => new AnnotationListNode([new FootnoteNode([InlineCompoundNode::getPlainTextInlineNode('Anonymous numbered footnote')], '#', 0)], 'footer-list'),
101101
],
102102
'single line Numbered footnote' => [
103103
'input' => '.. [42] Numbered footnote',
104-
'output' => new AnnotationListNode([new FootnoteNode([InlineCompoundNode::getPlainTextInlineNode('Numbered footnote')], '', 42)], 'footer-list'),
104+
'node' => new AnnotationListNode([new FootnoteNode([InlineCompoundNode::getPlainTextInlineNode('Numbered footnote')], '', 42)], 'footer-list'),
105105
],
106106
'single line named footnote' => [
107107
'input' => '.. [#somename] Named footnote',
108-
'output' => new AnnotationListNode([new FootnoteNode([InlineCompoundNode::getPlainTextInlineNode('Named footnote')], '#somename', 0)], 'footer-list'),
108+
'node' => new AnnotationListNode([new FootnoteNode([InlineCompoundNode::getPlainTextInlineNode('Named footnote')], '#somename', 0)], 'footer-list'),
109109
],
110110
'multi line citation' => [
111111
'input' => <<<'RST'
112112
.. [name] some multiline
113113
annotation
114114
RST
115115
,
116-
'output' => new AnnotationListNode([
116+
'node' => new AnnotationListNode([
117117
new CitationNode(
118118
[
119119
InlineCompoundNode::getPlainTextInlineNode(
@@ -136,7 +136,7 @@ public static function annotationProvider(): array
136136
This is a new paragraph
137137
RST
138138
,
139-
'output' => new AnnotationListNode([
139+
'node' => new AnnotationListNode([
140140
new CitationNode(
141141
[
142142
InlineCompoundNode::getPlainTextInlineNode(
@@ -159,7 +159,7 @@ public static function annotationProvider(): array
159159
This is a new paragraph
160160
RST
161161
,
162-
'output' => new AnnotationListNode([
162+
'node' => new AnnotationListNode([
163163
new FootnoteNode(
164164
[
165165
InlineCompoundNode::getPlainTextInlineNode(
@@ -183,7 +183,7 @@ public static function annotationProvider(): array
183183
This is a new paragraph
184184
RST
185185
,
186-
'output' => new AnnotationListNode([
186+
'node' => new AnnotationListNode([
187187
new FootnoteNode(
188188
[
189189
InlineCompoundNode::getPlainTextInlineNode(
@@ -208,7 +208,7 @@ public static function annotationProvider(): array
208208
This is a new paragraph
209209
RST
210210
,
211-
'output' => new AnnotationListNode([
211+
'node' => new AnnotationListNode([
212212
new FootnoteNode(
213213
[
214214
InlineCompoundNode::getPlainTextInlineNode('Footnote 1'),

packages/guides-restructured-text/tests/unit/Parser/Productions/ParagraphRuleTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ final class ParagraphRuleTest extends RuleTestCase
3030
#[DataProvider('paragraphProvider')]
3131
public function testParagraphNodeFromLinesIterator(
3232
string $input,
33-
ParagraphNode $node,
34-
string|null $nextLine,
33+
ParagraphNode $output,
34+
string|null $remaining,
3535
bool $nextLiteral = false,
3636
): void {
3737
$blockParser = $this->createContext($input);
@@ -43,11 +43,11 @@ public function testParagraphNodeFromLinesIterator(
4343
self::assertTrue($rule->applies($blockParser));
4444
$result = $rule->apply($blockParser);
4545
self::assertEquals(
46-
$node,
46+
$output,
4747
$result,
4848
);
4949

50-
self::assertSame($nextLine, $blockParser->getDocumentIterator()->getNextLine());
50+
self::assertSame($remaining, $blockParser->getDocumentIterator()->getNextLine());
5151
self::assertSame($nextLiteral, $blockParser->getDocumentParserContext()->nextIndentedBlockShouldBeALiteralBlock);
5252
}
5353

packages/guides-restructured-text/tests/unit/TextRoles/ReferenceTextRoleTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ public function setUp(): void
3333
#[DataProvider('referenceProvider')]
3434
public function testReferenceIsParsedIntoRefReferenceNode(
3535
string $span,
36-
string $url,
36+
string $referenceName,
3737
string|null $text = null,
3838
): void {
3939
$result = $this->referenceTextRole->processNode($this->documentParserContext, 'doc', $span, $span);
4040

4141
self::assertInstanceOf(ReferenceNode::class, $result);
42-
self::assertEquals($url, $result->getTargetReference(), 'ReferenceNames are different');
42+
self::assertEquals($referenceName, $result->getTargetReference(), 'ReferenceNames are different');
4343
self::assertEquals($text ?? '', $result->toString());
4444
}
4545

0 commit comments

Comments
 (0)