mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-01 20:19:42 +08:00
Fix #20423: strcmp() Passing null to parameter 2 ($string2) of type string is deprecated
This commit is contained in:
@ -1320,6 +1320,30 @@ class UrlRuleTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
public function testUrlRuleDefaultsWithNonStringValues()
|
||||
{
|
||||
$this->mockWebApplication();
|
||||
|
||||
$manager = new UrlManager(
|
||||
[
|
||||
'cache' => null,
|
||||
],
|
||||
);
|
||||
|
||||
$rule = new UrlRule(
|
||||
[
|
||||
'pattern' => 'post/index',
|
||||
'route' => 'post/index',
|
||||
'defaults' => ['page' => 1],
|
||||
],
|
||||
);
|
||||
|
||||
$this->assertSame(
|
||||
'post/index',
|
||||
$rule->createUrl($manager, 'post/index', ['page' => '1']),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides test cases for getCreateUrlStatus() method.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user