mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-21 14:37:21 +01:00
Add void return to method in tests. (#20602)
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user