@@ -104,7 +104,7 @@ public function testCollapsedEntityField()
104
104
{
105
105
$ this ->setMaxRunningTime (1 );
106
106
107
- for ($ i = 0 ; $ i < 20 ; ++$ i ) {
107
+ for ($ i = 0 ; $ i < 40 ; ++$ i ) {
108
108
$ form = $ this ->factory ->create ('entity ' , null , array (
109
109
'class ' => self ::ENTITY_CLASS ,
110
110
));
@@ -114,11 +114,14 @@ public function testCollapsedEntityField()
114
114
}
115
115
}
116
116
117
+ /**
118
+ * @group benchmark
119
+ */
117
120
public function testCollapsedEntityFieldWithQueryBuilder ()
118
121
{
119
122
$ this ->setMaxRunningTime (1 );
120
123
121
- for ($ i = 0 ; $ i < 20 ; ++$ i ) {
124
+ for ($ i = 0 ; $ i < 40 ; ++$ i ) {
122
125
$ form = $ this ->factory ->create ('entity ' , null , array (
123
126
'class ' => self ::ENTITY_CLASS ,
124
127
'query_builder ' => function (EntityRepository $ repo ) {
@@ -130,4 +133,42 @@ public function testCollapsedEntityFieldWithQueryBuilder()
130
133
$ form ->createView ();
131
134
}
132
135
}
136
+
137
+ /**
138
+ * @group benchmark
139
+ */
140
+ public function testCollapsedEntityFieldWithChoices ()
141
+ {
142
+ $ choices = $ this ->em ->createQuery ('SELECT c FROM ' . self ::ENTITY_CLASS . ' c ' )->getResult ();
143
+ $ this ->setMaxRunningTime (1 );
144
+
145
+ for ($ i = 0 ; $ i < 40 ; ++$ i ) {
146
+ $ form = $ this ->factory ->create ('entity ' , null , array (
147
+ 'class ' => self ::ENTITY_CLASS ,
148
+ 'choices ' => $ choices ,
149
+ ));
150
+
151
+ // force loading of the choice list
152
+ $ form ->createView ();
153
+ }
154
+ }
155
+
156
+ /**
157
+ * @group benchmark
158
+ */
159
+ public function testCollapsedEntityFieldWithPreferredChoices ()
160
+ {
161
+ $ choices = $ this ->em ->createQuery ('SELECT c FROM ' . self ::ENTITY_CLASS . ' c ' )->getResult ();
162
+ $ this ->setMaxRunningTime (1 );
163
+
164
+ for ($ i = 0 ; $ i < 40 ; ++$ i ) {
165
+ $ form = $ this ->factory ->create ('entity ' , null , array (
166
+ 'class ' => self ::ENTITY_CLASS ,
167
+ 'preferred_choices ' => $ choices ,
168
+ ));
169
+
170
+ // force loading of the choice list
171
+ $ form ->createView ();
172
+ }
173
+ }
133
174
}
0 commit comments