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

@@ -25,7 +25,7 @@ class RegularExpressionValidatorTest extends TestCase
$this->destroyApplication();
}
public function testValidateValue()
public function testValidateValue(): void
{
$val = new RegularExpressionValidator(['pattern' => '/^[a-zA-Z0-9](\.)?([^\/]*)$/m']);
$this->assertTrue($val->validate('b.4'));
@@ -37,7 +37,7 @@ class RegularExpressionValidatorTest extends TestCase
$this->assertFalse($val->validate(['a', 'b']));
}
public function testValidateAttribute()
public function testValidateAttribute(): void
{
$val = new RegularExpressionValidator(['pattern' => '/^[a-zA-Z0-9](\.)?([^\/]*)$/m']);
$m = FakedValidationModel::createWithAttributes(['attr_reg1' => 'b.4']);
@@ -48,13 +48,13 @@ class RegularExpressionValidatorTest extends TestCase
$this->assertTrue($m->hasErrors('attr_reg1'));
}
public function testMessageSetOnInit()
public function testMessageSetOnInit(): void
{
$val = new RegularExpressionValidator(['pattern' => '/^[a-zA-Z0-9](\.)?([^\/]*)$/m']);
$this->assertIsString($val->message);
}
public function testInitException()
public function testInitException(): void
{
$this->expectException('yii\base\InvalidConfigException');
$val = new RegularExpressionValidator();