From aa23b0eb739e92c694a0609f269d11b97a47d5e6 Mon Sep 17 00:00:00 2001 From: Master Yoda Date: Wed, 6 Jun 2018 07:32:26 -0700 Subject: [PATCH] Use the proper test stream filter --- tests/system/Commands/CommandsTest.php | 11 ++++++----- tests/system/Commands/SessionsCommandsTest.php | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/system/Commands/CommandsTest.php b/tests/system/Commands/CommandsTest.php index c99bf43857..00dd6439d6 100644 --- a/tests/system/Commands/CommandsTest.php +++ b/tests/system/Commands/CommandsTest.php @@ -1,9 +1,10 @@ stream_filter = stream_filter_append(STDOUT, 'CommandsTestStreamFilter'); + CITestStreamFilter::$buffer = ''; + $this->stream_filter = stream_filter_append(STDOUT, 'CITestStreamFilter'); $this->env = new \CodeIgniter\Config\DotEnv(ROOTPATH); $this->env->load(); @@ -42,7 +43,7 @@ class CommandsTest extends \CIUnitTestCase public function testHelpCommand() { $this->runner->index(['help']); - $result = CommandsTestStreamFilter::$buffer; + $result = CITestStreamFilter::$buffer; // make sure the result looks like a command list $this->assertContains('Displays basic usage information.', $result); @@ -52,7 +53,7 @@ class CommandsTest extends \CIUnitTestCase public function testListCommands() { $this->runner->index(['list']); - $result = CommandsTestStreamFilter::$buffer; + $result = CITestStreamFilter::$buffer; // make sure the result looks like a command list $this->assertContains('Lists the available commands.', $result); diff --git a/tests/system/Commands/SessionsCommandsTest.php b/tests/system/Commands/SessionsCommandsTest.php index 39e792889f..7171f8e8ad 100644 --- a/tests/system/Commands/SessionsCommandsTest.php +++ b/tests/system/Commands/SessionsCommandsTest.php @@ -1,9 +1,10 @@ stream_filter = stream_filter_append(STDOUT, 'CommandsTestStreamFilter'); + CITestStreamFilter::$buffer = ''; + $this->stream_filter = stream_filter_append(STDOUT, 'CITestStreamFilter'); $this->env = new \CodeIgniter\Config\DotEnv(ROOTPATH); $this->env->load(); @@ -41,7 +42,7 @@ class SessionsCommandsTest extends \CIUnitTestCase public function testCreateMigrationCommand() { $this->runner->index(['session:migration']); - $result = CommandsTestStreamFilter::$buffer; + $result = CITestStreamFilter::$buffer; // make sure we end up with a migration class in the right place // or at least that we claim to have done so @@ -58,7 +59,7 @@ class SessionsCommandsTest extends \CIUnitTestCase CLI::init(); $this->runner->index(['session:migration']); - $result = CommandsTestStreamFilter::$buffer; + $result = CITestStreamFilter::$buffer; // make sure we end up with a migration class in the right place $this->assertContains('Created file:', $result);