Add void return to method in tests. (#20602)

This commit is contained in:
Wilmer Arambula
2025-10-14 06:37:35 -03:00
committed by GitHub
parent 30824c5dcf
commit d71f7309ae
249 changed files with 2749 additions and 2538 deletions

View File

@@ -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');
}