Skip to content

Commit 91075b0

Browse files
committed
docs: improve explanation on setUp/tearDown
1 parent fce1561 commit 91075b0

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

user_guide_src/source/testing/overview.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,10 @@ to help with staging and clean up::
9595
protected function setUp(): void
9696
protected function tearDown(): void
9797

98-
The static methods run before and after the entire test case, whereas the local methods run
99-
between each test. If you implement any of these special functions make sure you run their
98+
The static methods ``setUpBeforeClass()`` and ``tearDownAfterClass()`` run before and after the entire test case, whereas the protected methods ``setUp()`` and ``tearDown()`` run
99+
between each test.
100+
101+
If you implement any of these special functions make sure you run their
100102
parent as well so extended test cases do not interfere with staging:
101103

102104
.. literalinclude:: overview/003.php

user_guide_src/source/testing/overview/003.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ final class OneOfMyModelsTest extends CIUnitTestCase
88
{
99
protected function setUp(): void
1010
{
11-
parent::setUp();
11+
parent::setUp(); // Do not forget
1212

1313
helper('text');
1414
}
15+
16+
// ...
1517
}

0 commit comments

Comments
 (0)