@@ -208,161 +208,6 @@ public function testCreateUsesBlockPrefixIfTypeGivenAsString()
208
208
$ this ->assertSame ('FORM ' , $ this ->factory ->create ('TYPE ' , null , $ options ));
209
209
}
210
210
211
- public function testCreateUsesTypeNameIfTypeGivenAsString ()
212
- {
213
- $ options = array ('a ' => '1 ' , 'b ' => '2 ' );
214
- $ resolvedOptions = array ('a ' => '2 ' , 'b ' => '3 ' );
215
- $ resolvedType = $ this ->getMockResolvedType ();
216
-
217
- $ this ->registry ->expects ($ this ->any ())
218
- ->method ('getType ' )
219
- ->with ('TYPE ' )
220
- ->will ($ this ->returnValue ($ resolvedType ));
221
-
222
- $ resolvedType ->expects ($ this ->once ())
223
- ->method ('createBuilder ' )
224
- ->with ($ this ->factory , 'type ' , $ options )
225
- ->will ($ this ->returnValue ($ this ->builder ));
226
-
227
- $ this ->builder ->expects ($ this ->any ())
228
- ->method ('getOptions ' )
229
- ->will ($ this ->returnValue ($ resolvedOptions ));
230
-
231
- $ resolvedType ->expects ($ this ->once ())
232
- ->method ('buildForm ' )
233
- ->with ($ this ->builder , $ resolvedOptions );
234
-
235
- $ this ->builder ->expects ($ this ->once ())
236
- ->method ('getForm ' )
237
- ->will ($ this ->returnValue ('FORM ' ));
238
-
239
- $ this ->assertSame ('FORM ' , $ this ->factory ->create ('TYPE ' , null , $ options ));
240
- }
241
-
242
- public function testCreateStripsNamespaceOffTypeName ()
243
- {
244
- $ options = array ('a ' => '1 ' , 'b ' => '2 ' );
245
- $ resolvedOptions = array ('a ' => '2 ' , 'b ' => '3 ' );
246
- $ resolvedType = $ this ->getMockResolvedType ();
247
-
248
- $ this ->registry ->expects ($ this ->any ())
249
- ->method ('getType ' )
250
- ->with ('Vendor\Name\Space\UserForm ' )
251
- ->will ($ this ->returnValue ($ resolvedType ));
252
-
253
- $ resolvedType ->expects ($ this ->once ())
254
- ->method ('createBuilder ' )
255
- ->with ($ this ->factory , 'user_form ' , $ options )
256
- ->will ($ this ->returnValue ($ this ->builder ));
257
-
258
- $ this ->builder ->expects ($ this ->any ())
259
- ->method ('getOptions ' )
260
- ->will ($ this ->returnValue ($ resolvedOptions ));
261
-
262
- $ resolvedType ->expects ($ this ->once ())
263
- ->method ('buildForm ' )
264
- ->with ($ this ->builder , $ resolvedOptions );
265
-
266
- $ this ->builder ->expects ($ this ->once ())
267
- ->method ('getForm ' )
268
- ->will ($ this ->returnValue ('FORM ' ));
269
-
270
- $ this ->assertSame ('FORM ' , $ this ->factory ->create ('Vendor\Name\Space\UserForm ' , null , $ options ));
271
- }
272
-
273
- public function testCreateStripsTypeSuffixOffTypeName ()
274
- {
275
- $ options = array ('a ' => '1 ' , 'b ' => '2 ' );
276
- $ resolvedOptions = array ('a ' => '2 ' , 'b ' => '3 ' );
277
- $ resolvedType = $ this ->getMockResolvedType ();
278
-
279
- $ this ->registry ->expects ($ this ->any ())
280
- ->method ('getType ' )
281
- ->with ('Vendor\Name\Space\UserType ' )
282
- ->will ($ this ->returnValue ($ resolvedType ));
283
-
284
- $ resolvedType ->expects ($ this ->once ())
285
- ->method ('createBuilder ' )
286
- ->with ($ this ->factory , 'user ' , $ options )
287
- ->will ($ this ->returnValue ($ this ->builder ));
288
-
289
- $ this ->builder ->expects ($ this ->any ())
290
- ->method ('getOptions ' )
291
- ->will ($ this ->returnValue ($ resolvedOptions ));
292
-
293
- $ resolvedType ->expects ($ this ->once ())
294
- ->method ('buildForm ' )
295
- ->with ($ this ->builder , $ resolvedOptions );
296
-
297
- $ this ->builder ->expects ($ this ->once ())
298
- ->method ('getForm ' )
299
- ->will ($ this ->returnValue ('FORM ' ));
300
-
301
- $ this ->assertSame ('FORM ' , $ this ->factory ->create ('Vendor\Name\Space\UserType ' , null , $ options ));
302
- }
303
-
304
- public function testCreateDoesNotStripTypeSuffixIfResultEmpty ()
305
- {
306
- $ options = array ('a ' => '1 ' , 'b ' => '2 ' );
307
- $ resolvedOptions = array ('a ' => '2 ' , 'b ' => '3 ' );
308
- $ resolvedType = $ this ->getMockResolvedType ();
309
-
310
- $ this ->registry ->expects ($ this ->any ())
311
- ->method ('getType ' )
312
- ->with ('Vendor\Name\Space\Type ' )
313
- ->will ($ this ->returnValue ($ resolvedType ));
314
-
315
- $ resolvedType ->expects ($ this ->once ())
316
- ->method ('createBuilder ' )
317
- ->with ($ this ->factory , 'type ' , $ options )
318
- ->will ($ this ->returnValue ($ this ->builder ));
319
-
320
- $ this ->builder ->expects ($ this ->any ())
321
- ->method ('getOptions ' )
322
- ->will ($ this ->returnValue ($ resolvedOptions ));
323
-
324
- $ resolvedType ->expects ($ this ->once ())
325
- ->method ('buildForm ' )
326
- ->with ($ this ->builder , $ resolvedOptions );
327
-
328
- $ this ->builder ->expects ($ this ->once ())
329
- ->method ('getForm ' )
330
- ->will ($ this ->returnValue ('FORM ' ));
331
-
332
- $ this ->assertSame ('FORM ' , $ this ->factory ->create ('Vendor\Name\Space\Type ' , null , $ options ));
333
- }
334
-
335
- public function testCreateConvertsTypeToUnderscoreSyntax ()
336
- {
337
- $ options = array ('a ' => '1 ' , 'b ' => '2 ' );
338
- $ resolvedOptions = array ('a ' => '2 ' , 'b ' => '3 ' );
339
- $ resolvedType = $ this ->getMockResolvedType ();
340
-
341
- $ this ->registry ->expects ($ this ->any ())
342
- ->method ('getType ' )
343
- ->with ('Vendor\Name\Space\MyProfileHTMLType ' )
344
- ->will ($ this ->returnValue ($ resolvedType ));
345
-
346
- $ resolvedType ->expects ($ this ->once ())
347
- ->method ('createBuilder ' )
348
- ->with ($ this ->factory , 'my_profile_html ' , $ options )
349
- ->will ($ this ->returnValue ($ this ->builder ));
350
-
351
- $ this ->builder ->expects ($ this ->any ())
352
- ->method ('getOptions ' )
353
- ->will ($ this ->returnValue ($ resolvedOptions ));
354
-
355
- $ resolvedType ->expects ($ this ->once ())
356
- ->method ('buildForm ' )
357
- ->with ($ this ->builder , $ resolvedOptions );
358
-
359
- $ this ->builder ->expects ($ this ->once ())
360
- ->method ('getForm ' )
361
- ->will ($ this ->returnValue ('FORM ' ));
362
-
363
- $ this ->assertSame ('FORM ' , $ this ->factory ->create ('Vendor\Name\Space\MyProfileHTMLType ' , null , $ options ));
364
- }
365
-
366
211
public function testCreateNamed ()
367
212
{
368
213
$ options = array ('a ' => '1 ' , 'b ' => '2 ' );
0 commit comments