@@ -87,9 +87,9 @@ public function setContentsReplacesContentsSetInPreviousCall(): void
87
87
}
88
88
89
89
/**
90
- * @return \Generator< array<array<DeclarationBlock> , DeclarationBlock, DeclarationBlock, array<DeclarationBlock>>>
90
+ * @return array<string, array<string , DeclarationBlock| array<int, DeclarationBlock>>>
91
91
*/
92
- public static function insertBeforeDataProvider (): \ Generator
92
+ public static function insertContentBeforeInsertsContentBeforeSibblingOrAppendsIfSibblingNotFoundDataProvider (): array
93
93
{
94
94
95
95
$ bogusOne = new DeclarationBlock ();
@@ -106,32 +106,28 @@ public static function insertBeforeDataProvider(): \Generator
106
106
$ oOrphan = new DeclarationBlock ();
107
107
$ oOrphan ->setSelectors ('.forever-alone ' );
108
108
109
- yield 'insert before ' => [
110
- 'initialContent ' => [$ bogusOne , $ oSibling , $ bogusTwo ],
111
- 'oItem ' => $ oItem ,
112
- 'oSibling ' => $ oSibling ,
113
- 'expectedContent ' => [$ bogusOne , $ oItem , $ oSibling , $ bogusTwo ],
114
- ];
115
- yield 'append if not found ' => [
116
- 'initialContent ' => [$ bogusOne , $ oSibling , $ bogusTwo ],
117
- 'oItem ' => $ oItem ,
118
- 'oSibling ' => $ oOrphan ,
119
- 'expectedContent ' => [$ bogusOne , $ oSibling , $ bogusTwo , $ oItem ],
120
- ];
109
+ return [
110
+ 'insert before ' => [
111
+ 'initialContent ' => [$ bogusOne , $ oSibling , $ bogusTwo ],
112
+ 'oItem ' => $ oItem ,
113
+ 'oSibling ' => $ oSibling ,
114
+ 'expectedContent ' => [$ bogusOne , $ oItem , $ oSibling , $ bogusTwo ],
115
+ ],
116
+ 'append if not found ' => [
117
+ 'initialContent ' => [$ bogusOne , $ oSibling , $ bogusTwo ],
118
+ 'oItem ' => $ oItem ,
119
+ 'oSibling ' => $ oOrphan ,
120
+ 'expectedContent ' => [$ bogusOne , $ oSibling , $ bogusTwo , $ oItem ],
121
+ ]
122
+ ];
121
123
}
122
124
123
125
/**
124
126
* @test
125
127
*
126
- * @param $initialContent
127
- * @param $oItem
128
- * @param $oSibling
129
- * @param $sPosition
130
- * @param $expectedContent
131
- *
132
128
* @dataProvider insertBeforeDataProvider
133
129
*/
134
- public function insertContentBefore (
130
+ public function insertContentBeforeInsertsContentBeforeSibblingOrAppendsIfSibblingNotFound (
135
131
array $ initialContent ,
136
132
DeclarationBlock $ oItem ,
137
133
DeclarationBlock $ oSibling ,
0 commit comments