* * For the full copyright and license information, please view * the LICENSE file that was distributed with this source code. */ namespace Tests\Commands; use CodeIgniter\Test\Filters\CITestStreamFilter; use Tests\Support\CLITestCase; /** * @internal */ final class QueueClearTest extends CLITestCase { public function testRunWithNoQueueName(): void { CITestStreamFilter::registration(); CITestStreamFilter::addErrorFilter(); $this->assertNotFalse(command('queue:clear')); $output = $this->parseOutput(CITestStreamFilter::$buffer); CITestStreamFilter::removeErrorFilter(); $this->assertSame('The queueName is not specified.', $output); } public function testRun(): void { CITestStreamFilter::registration(); CITestStreamFilter::addOutputFilter(); $this->assertNotFalse(command('queue:clear test')); $output = $this->parseOutput(CITestStreamFilter::$buffer); CITestStreamFilter::removeOutputFilter(); $this->assertSame('Queue test has been cleared.', $output); } }