File tree Expand file tree Collapse file tree
tests/3-unit/GlpiPlugin/Formcreator/Field Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -150,29 +150,38 @@ public function testGetValueForDesign($value, $expected) {
150150
151151
152152 public function providerRegex () {
153+ $ authLdap = new AuthLDAP ();
154+ $ authLdap ->add ([]);
155+
153156 yield 'value matches regex ' => [
154- 'value ' => 'foo ' ,
155- 'pattern ' => '/foo/ ' ,
156- 'expected ' => true ,
157+ 'value ' => 'foo ' ,
158+ 'pattern ' => '/foo/ ' ,
159+ 'expected ' => true ,
160+ 'ldap_auth ' => $ authLdap ->getID (),
157161 ];
158162 yield 'value does not match regex ' => [
159- 'value ' => 'foo ' ,
160- 'pattern ' => '/bar/ ' ,
161- 'expected ' => false ,
163+ 'value ' => 'foo ' ,
164+ 'pattern ' => '/bar/ ' ,
165+ 'expected ' => false ,
166+ 'ldap_auth ' => $ authLdap ->getID (),
162167 ];
163168 yield 'empty value does not match regex ' => [
164- 'value ' => '' ,
165- 'pattern ' => '/foo/ ' ,
166- 'expected ' => false ,
169+ 'value ' => '' ,
170+ 'pattern ' => '/foo/ ' ,
171+ 'expected ' => false ,
172+ 'ldap_auth ' => $ authLdap ->getID (),
167173 ];
168174 }
169175
170176 /**
171177 * @dataProvider providerRegex
172178 */
173- public function testRegex ($ value , $ pattern , $ expected ) {
179+ public function testRegex ($ value , $ pattern , $ expected, $ ldap_auth ) {
174180 $ instance = $ this ->newTestedInstance ($ this ->getQuestion ([
175- 'fieldtype ' => 'ldapselect ' ,
181+ 'fieldtype ' => 'ldapselect ' ,
182+ 'ldap_auth ' => $ ldap_auth ,
183+ 'ldap_filter ' => '' ,
184+ 'ldap_attribute ' => '1 ' ,
176185 ]));
177186 $ instance ->deserializeValue ($ value );
178187 $ output = $ instance ->regex ($ pattern );
You can’t perform that action at this time.
0 commit comments