@@ -87,9 +87,9 @@ public function setContentsReplacesContentsSetInPreviousCall(): void
87
87
}
88
88
89
89
/**
90
- * @return Generator
90
+ * @return \ Generator<array<array<DeclarationBlock>, DeclarationBlock, DeclarationBlock, array<DeclarationBlock>>>
91
91
*/
92
- public static function insertDataProvider (): \Generator
92
+ public static function insertBeforeDataProvider (): \Generator
93
93
{
94
94
95
95
$ bogusOne = new DeclarationBlock ();
@@ -110,21 +110,12 @@ public static function insertDataProvider(): \Generator
110
110
'initialContent ' => [$ bogusOne , $ oSibling , $ bogusTwo ],
111
111
'oItem ' => $ oItem ,
112
112
'oSibling ' => $ oSibling ,
113
- 'position ' => 'before ' ,
114
113
'expectedContent ' => [$ bogusOne , $ oItem , $ oSibling , $ bogusTwo ],
115
114
];
116
- yield 'insert after ' => [
117
- 'initialContent ' => [$ bogusOne , $ oSibling , $ bogusTwo ],
118
- 'oItem ' => $ oItem ,
119
- 'oSibling ' => $ oSibling ,
120
- 'position ' => 'after ' ,
121
- 'expectedContent ' => [$ bogusOne , $ oSibling , $ oItem , $ bogusTwo ],
122
- ];
123
115
yield 'append if not found ' => [
124
116
'initialContent ' => [$ bogusOne , $ oSibling , $ bogusTwo ],
125
117
'oItem ' => $ oItem ,
126
118
'oSibling ' => $ oOrphan ,
127
- 'position ' => 'before ' ,
128
119
'expectedContent ' => [$ bogusOne , $ oSibling , $ bogusTwo , $ oItem ],
129
120
];
130
121
}
@@ -138,21 +129,20 @@ public static function insertDataProvider(): \Generator
138
129
* @param $sPosition
139
130
* @param $expectedContent
140
131
*
141
- * @dataProvider insertDataProvider
132
+ * @dataProvider insertBeforeDataProvider
142
133
*/
143
- public function insertContent (
134
+ public function insertContentBefore (
144
135
array $ initialContent ,
145
136
DeclarationBlock $ oItem ,
146
137
DeclarationBlock $ oSibling ,
147
- string $ sPosition ,
148
138
array $ expectedContent
149
139
) {
150
140
151
141
$ this ->subject ->setContents ($ initialContent );
152
142
153
143
self ::assertCount (3 , $ this ->subject ->getContents ());
154
144
155
- $ this ->subject ->insert ($ oItem , $ oSibling, $ sPosition );
145
+ $ this ->subject ->insertBefore ($ oItem , $ oSibling );
156
146
157
147
self ::assertCount (4 , $ this ->subject ->getContents ());
158
148
self ::assertSame ($ expectedContent , $ this ->subject ->getContents ());
0 commit comments