mirror of
https://github.com/yiisoft/yii2.git
synced 2025-12-19 07:07:58 +08:00
Add void return to method in tests. (#20602)
This commit is contained in:
@@ -86,7 +86,7 @@ class ConsoleTest extends TestCase
|
||||
rewind(ConsoleStub::$inputStream);
|
||||
}
|
||||
|
||||
public function testStripAnsiFormat()
|
||||
public function testStripAnsiFormat(): void
|
||||
{
|
||||
ob_start();
|
||||
ob_implicit_flush(false);
|
||||
@@ -201,12 +201,12 @@ class ConsoleTest extends TestCase
|
||||
* @param string $ansi
|
||||
* @param string $html
|
||||
*/
|
||||
public function testAnsi2Html($ansi, $html)
|
||||
public function testAnsi2Html($ansi, $html): void
|
||||
{
|
||||
$this->assertEquals($html, Console::ansiToHtml($ansi));
|
||||
}
|
||||
|
||||
public function testErrorSummary()
|
||||
public function testErrorSummary(): void
|
||||
{
|
||||
$model = new TestConsoleModel();
|
||||
$model->name = 'not_an_integer';
|
||||
@@ -221,7 +221,7 @@ class ConsoleTest extends TestCase
|
||||
/**
|
||||
* @covers \yii\helpers\BaseConsole::input()
|
||||
*/
|
||||
public function testInput()
|
||||
public function testInput(): void
|
||||
{
|
||||
$this->sendInput('test1');
|
||||
$result = ConsoleStub::input();
|
||||
@@ -239,7 +239,7 @@ class ConsoleTest extends TestCase
|
||||
/**
|
||||
* @covers \yii\helpers\BaseConsole::output()
|
||||
*/
|
||||
public function testOutput()
|
||||
public function testOutput(): void
|
||||
{
|
||||
$result = ConsoleStub::output('Smth');
|
||||
$this->assertEquals('Smth' . PHP_EOL, $this->readOutput());
|
||||
@@ -249,7 +249,7 @@ class ConsoleTest extends TestCase
|
||||
/**
|
||||
* @covers \yii\helpers\BaseConsole::error()
|
||||
*/
|
||||
public function testError()
|
||||
public function testError(): void
|
||||
{
|
||||
$result = ConsoleStub::error('SomeError');
|
||||
$this->assertEquals('SomeError' . PHP_EOL, $this->readOutput(ConsoleStub::$errorStream));
|
||||
@@ -259,7 +259,7 @@ class ConsoleTest extends TestCase
|
||||
/**
|
||||
* @covers \yii\helpers\BaseConsole::prompt()
|
||||
*/
|
||||
public function testPrompt()
|
||||
public function testPrompt(): void
|
||||
{
|
||||
// testing output variations
|
||||
|
||||
@@ -350,7 +350,7 @@ class ConsoleTest extends TestCase
|
||||
/**
|
||||
* @covers \yii\helpers\BaseConsole::confirm()
|
||||
*/
|
||||
public function testConfirm()
|
||||
public function testConfirm(): void
|
||||
{
|
||||
$this->sendInput('y');
|
||||
ConsoleStub::confirm('Are you sure?');
|
||||
@@ -392,7 +392,7 @@ class ConsoleTest extends TestCase
|
||||
/**
|
||||
* @covers \yii\helpers\BaseConsole::select()
|
||||
*/
|
||||
public function testSelect()
|
||||
public function testSelect(): void
|
||||
{
|
||||
$options = [
|
||||
'c' => 'cat',
|
||||
@@ -457,7 +457,7 @@ class TestConsoleModel extends DynamicModel
|
||||
];
|
||||
}
|
||||
|
||||
public function init()
|
||||
public function init(): void
|
||||
{
|
||||
$this->defineAttribute('name');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user