1111
1212namespace CodeIgniter ;
1313
14+ use CodeIgniter \Config \Factories ;
1415use CodeIgniter \HTTP \IncomingRequest ;
1516use CodeIgniter \HTTP \Request ;
1617use CodeIgniter \HTTP \Response ;
2122use Config \App ;
2223use Config \Services ;
2324use Psr \Log \LoggerInterface ;
25+ use Tests \Support \Config \Validation ;
2426
2527/**
2628 * Exercise our core Controller class.
@@ -118,15 +120,8 @@ public function testValidateWithStringRulesNotFound()
118120
119121 public function testValidateWithStringRulesFoundReadMessagesFromValidationConfig ()
120122 {
121- $ validation = config ('Validation ' );
122- $ validation ->signup = [
123- 'username ' => 'required ' ,
124- ];
125- $ validation ->signup_errors = [
126- 'username ' => [
127- 'required ' => 'You must choose a username. ' ,
128- ],
129- ];
123+ $ validation = new Validation ();
124+ Factories::injectMock ('config ' , 'Validation ' , $ validation );
130125
131126 // make sure we can instantiate one
132127 $ this ->controller = new Controller ();
@@ -139,10 +134,8 @@ public function testValidateWithStringRulesFoundReadMessagesFromValidationConfig
139134
140135 public function testValidateWithStringRulesFoundUseMessagesParameter ()
141136 {
142- $ validation = config ('Validation ' );
143- $ validation ->signup = [
144- 'username ' => 'required ' ,
145- ];
137+ $ validation = new Validation ();
138+ Factories::injectMock ('config ' , 'Validation ' , $ validation );
146139
147140 // make sure we can instantiate one
148141 $ this ->controller = new Controller ();
0 commit comments