@@ -50,7 +50,8 @@ protected function setUp(): void
5050 {
5151 parent ::setUp ();
5252
53- $ this ->resetServices ();
53+ $ this ->resetServices (true );
54+ $ this ->resetFactories ();
5455 }
5556
5657 private function createCodeigniter (): void
@@ -92,7 +93,8 @@ public function testResourceGet()
9293 $ this ->codeigniter ->useSafeOutput (true )->run ($ this ->routes );
9394 $ output = ob_get_clean ();
9495
95- $ this ->assertStringContainsString (lang ('RESTful.notImplemented ' , ['index ' ]), $ output );
96+ $ error = json_decode ($ output )->messages ->error ;
97+ $ this ->assertStringContainsString (lang ('RESTful.notImplemented ' , ['index ' ]), $ error );
9698 }
9799
98100 public function testResourceGetNew ()
@@ -113,7 +115,8 @@ public function testResourceGetNew()
113115 $ this ->codeigniter ->useSafeOutput (true )->run ($ this ->routes );
114116 $ output = ob_get_clean ();
115117
116- $ this ->assertStringContainsString (lang ('RESTful.notImplemented ' , ['new ' ]), $ output );
118+ $ error = json_decode ($ output )->messages ->error ;
119+ $ this ->assertStringContainsString (lang ('RESTful.notImplemented ' , ['new ' ]), $ error );
117120 }
118121
119122 public function testResourceGetEdit ()
@@ -135,7 +138,8 @@ public function testResourceGetEdit()
135138 $ this ->codeigniter ->useSafeOutput (true )->run ($ this ->routes );
136139 $ output = ob_get_clean ();
137140
138- $ this ->assertStringContainsString (lang ('RESTful.notImplemented ' , ['edit ' ]), $ output );
141+ $ error = json_decode ($ output )->messages ->error ;
142+ $ this ->assertStringContainsString (lang ('RESTful.notImplemented ' , ['edit ' ]), $ error );
139143 }
140144
141145 public function testResourceGetOne ()
@@ -156,7 +160,8 @@ public function testResourceGetOne()
156160 $ this ->codeigniter ->useSafeOutput (true )->run ($ this ->routes );
157161 $ output = ob_get_clean ();
158162
159- $ this ->assertStringContainsString (lang ('RESTful.notImplemented ' , ['show ' ]), $ output );
163+ $ error = json_decode ($ output )->messages ->error ;
164+ $ this ->assertStringContainsString (lang ('RESTful.notImplemented ' , ['show ' ]), $ error );
160165 }
161166
162167 public function testResourcePost ()
@@ -176,7 +181,8 @@ public function testResourcePost()
176181 $ this ->codeigniter ->useSafeOutput (true )->run ($ this ->routes );
177182 $ output = ob_get_clean ();
178183
179- $ this ->assertStringContainsString (lang ('RESTful.notImplemented ' , ['create ' ]), $ output );
184+ $ error = json_decode ($ output )->messages ->error ;
185+ $ this ->assertStringContainsString (lang ('RESTful.notImplemented ' , ['create ' ]), $ error );
180186 }
181187
182188 public function testResourcePatch ()
@@ -197,7 +203,8 @@ public function testResourcePatch()
197203 $ this ->codeigniter ->useSafeOutput (true )->run ($ this ->routes );
198204 $ output = ob_get_clean ();
199205
200- $ this ->assertStringContainsString (lang ('RESTful.notImplemented ' , ['patch ' ]), $ output );
206+ $ error = json_decode ($ output )->messages ->error ;
207+ $ this ->assertStringContainsString (lang ('RESTful.notImplemented ' , ['update ' ]), $ error );
201208 }
202209
203210 public function testResourcePut ()
@@ -218,7 +225,8 @@ public function testResourcePut()
218225 $ this ->codeigniter ->useSafeOutput (true )->run ($ this ->routes );
219226 $ output = ob_get_clean ();
220227
221- $ this ->assertStringContainsString (lang ('RESTful.notImplemented ' , ['put ' ]), $ output );
228+ $ error = json_decode ($ output )->messages ->error ;
229+ $ this ->assertStringContainsString (lang ('RESTful.notImplemented ' , ['update ' ]), $ error );
222230 }
223231
224232 public function testResourceDelete ()
@@ -239,7 +247,8 @@ public function testResourceDelete()
239247 $ this ->codeigniter ->useSafeOutput (true )->run ($ this ->routes );
240248 $ output = ob_get_clean ();
241249
242- $ this ->assertStringContainsString (lang ('RESTful.notImplemented ' , ['delete ' ]), $ output );
250+ $ error = json_decode ($ output )->messages ->error ;
251+ $ this ->assertStringContainsString (lang ('RESTful.notImplemented ' , ['delete ' ]), $ error );
243252 }
244253
245254 public function testModel ()
0 commit comments