Skip to content

Commit 95e8751

Browse files
committed
docs: add sample for STDERR testing
1 parent 0438a1b commit 95e8751

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

user_guide_src/source/installation/upgrade_430.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ The way error and output streams are captured has changed. Now instead of::
142142
{
143143
CITestStreamFilter::$buffer = '';
144144
$this->stream_filter = stream_filter_append(STDOUT, 'CITestStreamFilter');
145+
$this->streamFilter = stream_filter_append(STDERR, 'CITestStreamFilter');
145146
}
146147

147148
protected function tearDown(): void
@@ -157,11 +158,13 @@ need to use::
157158
{
158159
CITestStreamFilter::registration();
159160
CITestStreamFilter::addOutputFilter();
161+
CITestStreamFilter::addErrorFilter();
160162
}
161163

162164
protected function tearDown(): void
163165
{
164166
CITestStreamFilter::removeOutputFilter();
167+
CITestStreamFilter::removeErrorFilter();
165168
}
166169

167170
Or use the trait ``CodeIgniter\Test\StreamFilterTrait``. See :ref:`testing-cli-output`.

0 commit comments

Comments
 (0)