@@ -87,9 +87,9 @@ public function setContentsReplacesContentsSetInPreviousCall(): void
8787 }
8888
8989 /**
90- * @return Generator
90+ * @return \ Generator<array<array<DeclarationBlock>, DeclarationBlock, DeclarationBlock, array<DeclarationBlock>>>
9191 */
92- public static function insertDataProvider (): \Generator
92+ public static function insertBeforeDataProvider (): \Generator
9393 {
9494
9595 $ bogusOne = new DeclarationBlock ();
@@ -110,21 +110,12 @@ public static function insertDataProvider(): \Generator
110110 'initialContent ' => [$ bogusOne , $ oSibling , $ bogusTwo ],
111111 'oItem ' => $ oItem ,
112112 'oSibling ' => $ oSibling ,
113- 'position ' => 'before ' ,
114113 'expectedContent ' => [$ bogusOne , $ oItem , $ oSibling , $ bogusTwo ],
115114 ];
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- ];
123115 yield 'append if not found ' => [
124116 'initialContent ' => [$ bogusOne , $ oSibling , $ bogusTwo ],
125117 'oItem ' => $ oItem ,
126118 'oSibling ' => $ oOrphan ,
127- 'position ' => 'before ' ,
128119 'expectedContent ' => [$ bogusOne , $ oSibling , $ bogusTwo , $ oItem ],
129120 ];
130121 }
@@ -138,21 +129,20 @@ public static function insertDataProvider(): \Generator
138129 * @param $sPosition
139130 * @param $expectedContent
140131 *
141- * @dataProvider insertDataProvider
132+ * @dataProvider insertBeforeDataProvider
142133 */
143- public function insertContent (
134+ public function insertContentBefore (
144135 array $ initialContent ,
145136 DeclarationBlock $ oItem ,
146137 DeclarationBlock $ oSibling ,
147- string $ sPosition ,
148138 array $ expectedContent
149139 ) {
150140
151141 $ this ->subject ->setContents ($ initialContent );
152142
153143 self ::assertCount (3 , $ this ->subject ->getContents ());
154144
155- $ this ->subject ->insert ($ oItem , $ oSibling, $ sPosition );
145+ $ this ->subject ->insertBefore ($ oItem , $ oSibling );
156146
157147 self ::assertCount (4 , $ this ->subject ->getContents ());
158148 self ::assertSame ($ expectedContent , $ this ->subject ->getContents ());
0 commit comments