You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -26,24 +26,24 @@ classes have been deprecated and their methods moved to ``DatabaseTestTrait`` an
26
26
``FeatureTestTrait`` respectively. Update your test cases to extend the main test case
27
27
and use any traits you need. For example::
28
28
29
-
use CodeIgniter\Test\DatabaseTestCase;
29
+
use CodeIgniter\Test\DatabaseTestCase;
30
30
31
-
class MyDatabaseTest extends DatabaseTestCase
32
-
{
33
-
public function testBadRow()
34
-
{
31
+
class MyDatabaseTest extends DatabaseTestCase
32
+
{
33
+
public function testBadRow()
34
+
{
35
35
36
36
... becomes::
37
37
38
-
use CodeIgniter\Test\CIUnitTestCase;
39
-
use CodeIgniter\Test\DatabaseTestTrait;
38
+
use CodeIgniter\Test\CIUnitTestCase;
39
+
use CodeIgniter\Test\DatabaseTestTrait;
40
40
41
-
class MyDatabaseTest extends CIUnitTestCase
42
-
{
43
-
use DatabaseTestTrait;
41
+
class MyDatabaseTest extends CIUnitTestCase
42
+
{
43
+
use DatabaseTestTrait;
44
44
45
-
public function testBadRow()
46
-
{
45
+
public function testBadRow()
46
+
{
47
47
48
48
Finally, ``ControllerTester`` has been superseded by ``ControllerTestTrait`` to standardize
49
49
approach and take advantage of the updated response testing (below).
@@ -55,5 +55,6 @@ The tools for testing responses have been consolidated and improved. A new
55
55
set of methods and properties expected from both those classes. In most cases these changes
56
56
will be "behind the scenes" by ``ControllerTestTrait`` and ``FeatureTestCase``, but two
57
57
changes to be aware of:
58
+
58
59
* ``TestResponse``'s ``$request`` and ``$response`` properties are protected and should only be access through their getter methods, ``request()`` and ``response()``
59
60
* ``TestResponse`` does not have ``getBody()`` and ``setBody()`` methods, but rather uses the Response methods directly, e.g.: ``$body = $result->response()->getBody();``
0 commit comments