File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -148,6 +148,38 @@ public function testGetRowsWithStaticItems() : void
148
148
self ::assertEquals (['One Two ' ], $ item ->getRows ($ menuStyle ));
149
149
}
150
150
151
+ public function testSetGutter () : void
152
+ {
153
+ $ menuStyle = $ this ->createMock (MenuStyle::class);
154
+
155
+ $ menuStyle
156
+ ->expects ($ this ->any ())
157
+ ->method ('getContentWidth ' )
158
+ ->will ($ this ->returnValue (20 ));
159
+
160
+ $ item = new SplitItem ([new StaticItem ('One Two ' ), new StaticItem ('Three ' )]);
161
+
162
+ self ::assertEquals (['One Two Three ' ], $ item ->getRows ($ menuStyle ));
163
+
164
+ $ item ->setGutter (5 );
165
+
166
+ self ::assertEquals (['One Three ' , 'Two ' ], $ item ->getRows ($ menuStyle ));
167
+ }
168
+
169
+ /**
170
+ * @dataProvider belowZeroProvider
171
+ */
172
+ public function testSetGutterThrowsExceptionIfValueIsNotZeroOrAbove (int $ value ) : void
173
+ {
174
+ self ::expectException (\Assert \InvalidArgumentException::class);
175
+ $ item = new SplitItem ();
176
+ $ item ->setGutter ($ value );
177
+ }
178
+ public function belowZeroProvider () : array
179
+ {
180
+ return [[-1 ], [-2 ], [-10 ]];
181
+ }
182
+
151
183
public function testGetRowsWithOneItemSelected () : void
152
184
{
153
185
$ menuStyle = $ this ->createMock (MenuStyle::class);
You can’t perform that action at this time.
0 commit comments