Fix #20423: strcmp() Passing null to parameter 2 ($string2) of type string is deprecated

This commit is contained in:
Wilmer Arambula
2025-06-19 12:24:22 -04:00
committed by GitHub
parent 0a52f10ea6
commit 4c5a6c5035
3 changed files with 28 additions and 1 deletions

View File

@ -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.
*