Use the proper test stream filter

This commit is contained in:
Master Yoda 2018-06-06 07:32:26 -07:00
parent 4174a4c97d
commit aa23b0eb73
No known key found for this signature in database
GPG Key ID: CED549230775AD5B
2 changed files with 12 additions and 10 deletions

View File

@ -1,9 +1,10 @@
<?php namespace CodeIgniter\Commands;
use Config\MockAppConfig;
use Tests\Support\Config\MockAppConfig;
use CodeIgniter\HTTP\UserAgent;
use CodeIgniter\CLI\CLI;
use CodeIgniter\CLI\CommandRunner;
use CodeIgniter\Test\Filters\CITestStreamFilter;
class CommandsTest extends \CIUnitTestCase
{
@ -12,8 +13,8 @@ class CommandsTest extends \CIUnitTestCase
public function setUp()
{
CommandsTestStreamFilter::$buffer = '';
$this->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);

View File

@ -1,9 +1,10 @@
<?php namespace CodeIgniter\Commands;
use Config\MockAppConfig;
use Tests\Support\Config\MockAppConfig;
use CodeIgniter\HTTP\UserAgent;
use CodeIgniter\CLI\CLI;
use CodeIgniter\CLI\CommandRunner;
use CodeIgniter\Test\Filters\CITestStreamFilter;
class SessionsCommandsTest extends \CIUnitTestCase
{
@ -11,8 +12,8 @@ class SessionsCommandsTest extends \CIUnitTestCase
public function setUp()
{
CommandsTestStreamFilter::$buffer = '';
$this->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);