@@ -96,7 +96,10 @@ public function testRest()
96
96
$ html = $ this ->renderRest ($ view );
97
97
98
98
$ this ->assertMatchesXpath ($ html ,
99
- '/div
99
+ '/input
100
+ [@type="hidden"]
101
+ [@id="name__token"]
102
+ /following-sibling::div
100
103
[
101
104
./label[@for="name_field1"]
102
105
/following-sibling::input[@type="text"][@id="name_field1"]
@@ -109,9 +112,6 @@ public function testRest()
109
112
[count(../div)=2]
110
113
[count(..//label)=2]
111
114
[count(..//input)=3]
112
- /following-sibling::input
113
- [@type="hidden"]
114
- [@id="name__token"]
115
115
'
116
116
);
117
117
}
@@ -144,7 +144,8 @@ public function testRestWithChildrenForms()
144
144
$ html = $ this ->renderRest ($ view );
145
145
146
146
$ this ->assertMatchesXpath ($ html ,
147
- '/div
147
+ '/input[@type="hidden"][@id="parent__token"]
148
+ /following-sibling::div
148
149
[
149
150
./label[not(@for)]
150
151
/following-sibling::div[@id="parent_child1"]
@@ -171,7 +172,6 @@ public function testRestWithChildrenForms()
171
172
]
172
173
[count(//label)=4]
173
174
[count(//input[@type="text"])=2]
174
- /following-sibling::input[@type="hidden"][@id="parent__token"]
175
175
'
176
176
);
177
177
}
@@ -189,15 +189,15 @@ public function testRestAndRepeatedWithRow()
189
189
$ html = $ this ->renderRest ($ view );
190
190
191
191
$ this ->assertMatchesXpath ($ html ,
192
- '/div
192
+ '/input
193
+ [@type="hidden"]
194
+ [@id="name__token"]
195
+ /following-sibling::div
193
196
[
194
197
./label[@for="name_first"]
195
198
/following-sibling::input[@type="text"][@id="name_first"]
196
199
]
197
200
[count(.//input)=1]
198
- /following-sibling::input
199
- [@type="hidden"]
200
- [@id="name__token"]
201
201
'
202
202
);
203
203
}
@@ -216,16 +216,16 @@ public function testRestAndRepeatedWithRowPerChild()
216
216
$ html = $ this ->renderRest ($ view );
217
217
218
218
$ this ->assertMatchesXpath ($ html ,
219
- '/div
219
+ '/input
220
+ [@type="hidden"]
221
+ [@id="name__token"]
222
+ /following-sibling::div
220
223
[
221
224
./label[@for="name_first"]
222
225
/following-sibling::input[@type="text"][@id="name_first"]
223
226
]
224
227
[count(.//input)=1]
225
228
[count(.//label)=1]
226
- /following-sibling::input
227
- [@type="hidden"]
228
- [@id="name__token"]
229
229
'
230
230
);
231
231
}
@@ -246,16 +246,16 @@ public function testRestAndRepeatedWithWidgetPerChild()
246
246
$ html = $ this ->renderRest ($ view );
247
247
248
248
$ this ->assertMatchesXpath ($ html ,
249
- '/div
249
+ '/input
250
+ [@type="hidden"]
251
+ [@id="name__token"]
252
+ /following-sibling::div
250
253
[
251
254
./label[@for="name_first"]
252
255
/following-sibling::input[@type="text"][@id="name_first"]
253
256
]
254
257
[count(//input)=2]
255
258
[count(//label)=1]
256
- /following-sibling::input
257
- [@type="hidden"]
258
- [@id="name__token"]
259
259
'
260
260
);
261
261
}
@@ -293,7 +293,8 @@ public function testCollectionRow()
293
293
$ this ->assertWidgetMatchesXpath ($ form ->createView (), array (),
294
294
'/div
295
295
[
296
- ./div
296
+ ./input[@type="hidden"][@id="form__token"]
297
+ /following-sibling::div
297
298
[
298
299
./label[not(@for)]
299
300
/following-sibling::div
@@ -310,7 +311,6 @@ public function testCollectionRow()
310
311
]
311
312
]
312
313
]
313
- /following-sibling::input[@type="hidden"][@id="form__token"]
314
314
]
315
315
[count(.//input)=3]
316
316
'
@@ -327,7 +327,8 @@ public function testForm()
327
327
$ this ->assertWidgetMatchesXpath ($ form ->createView (), array (),
328
328
'/div
329
329
[
330
- ./div
330
+ ./input[@type="hidden"][@id="name__token"]
331
+ /following-sibling::div
331
332
[
332
333
./label[@for="name_firstName"]
333
334
/following-sibling::input[@type="text"][@id="name_firstName"]
@@ -337,7 +338,6 @@ public function testForm()
337
338
./label[@for="name_lastName"]
338
339
/following-sibling::input[@type="text"][@id="name_lastName"]
339
340
]
340
- /following-sibling::input[@type="hidden"][@id="name__token"]
341
341
]
342
342
[count(.//input)=3]
343
343
'
@@ -383,8 +383,8 @@ public function testCsrf()
383
383
$ this ->assertWidgetMatchesXpath ($ form ->createView (), array (),
384
384
'/div
385
385
[
386
- ./div
387
- /following-sibling::input[@type="hidden"][@id="name__token"][@value="foo&bar"]
386
+ ./input[@type="hidden"][@id="name__token"][@value="foo&bar"]
387
+ /following-sibling::div
388
388
]
389
389
[count(.//input[@type="hidden"])=1]
390
390
'
@@ -400,7 +400,8 @@ public function testRepeated()
400
400
$ this ->assertWidgetMatchesXpath ($ form ->createView (), array (),
401
401
'/div
402
402
[
403
- ./div
403
+ ./input[@type="hidden"][@id="name__token"]
404
+ /following-sibling::div
404
405
[
405
406
./label[@for="name_first"]
406
407
/following-sibling::input[@type="text"][@id="name_first"]
@@ -410,7 +411,6 @@
10000
public function testRepeated()
410
411
./label[@for="name_second"]
411
412
/following-sibling::input[@type="text"][@id="name_second"]
412
413
]
413
- /following-sibling::input[@type="hidden"][@id="name__token"]
414
414
]
415
415
[count(.//input)=3]
416
416
'
@@ -428,7 +428,8 @@ public function testRepeatedWithCustomOptions()
428
428
$ this ->assertWidgetMatchesXpath ($ form ->createView (), array (),
429
429
'/div
430
430
[
431
- ./div
431
+ ./input[@type="hidden"][@id="name__token"]
432
+ /following-sibling::div
432
433
[
433
434
./label[@for="name_first"][.="[trans]Test[/trans]"]
434
435
/following-sibling::input[@type="text"][@id="name_first"][@required="required"]
@@ -438,7 +439,6 @@ public function testRepeatedWithCustomOptions()
438
439
./label[@for="name_second"][.="[trans]Test2[/trans]"]
439
440
/following-sibling::input[@type="text"][@id="name_second"][@required="required"]
440
441
]
441
- /following-sibling::input[@type="hidden"][@id="name__token"]
442
442
]
443
443
[count(.//input)=3]
444
444
'
@@ -454,12 +454,12 @@ public function testSearchInputName()
454
454
$ this ->assertWidgetMatchesXpath ($ form ->createView (), array (),
455
455
'/div
456
456
[
457
- ./div
457
+ ./input[@type="hidden"][@id="full__token"]
458
+ /following-sibling::div
458
459
[
459
460
./label[@for="full_name"]
460
461
/following-sibling::input[@type="search"][@id="full_name"][@name="full[name]"]
461
462
]
462
- /following-sibling::input[@type="hidden"][@id="full__token"]
463
463
]
464
464
[count(//input)=2]
465
465
'
@@ -521,7 +521,8 @@ public function testThemeInheritance($parentTheme, $childTheme)
521
521
$ this ->assertWidgetMatchesXpath ($ view , array (),
522
522
'/div
523
523
[
524
- ./div
524
+ ./input[@type="hidden"]
525
+ /following-sibling::div
525
526
[
526
527
./label[.="parent"]
527
528
/following-sibling::input[@type="text"]
@@ -538,7 +539,6 @@ public function testThemeInheritance($parentTheme, $childTheme)
538
539
]
539
540
]
540
541
]
541
- /following-sibling::input[@type="hidden"]
542
542
]
543
543
'
544
544
);
0 commit comments