mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
Fix #17929: Actions can now have bool typed params bound
This commit is contained in:
@ -59,10 +59,12 @@ class ControllerTest extends TestCase
|
||||
|
||||
$aksi1 = new InlineAction('aksi1', $this->controller, 'actionAksi1');
|
||||
|
||||
$params = ['foo' => '100', 'bar' => null];
|
||||
list($foo, $bar) = $this->controller->bindActionParams($aksi1, $params);
|
||||
$params = ['foo' => '100', 'bar' => null, 'true' => 'on', 'false' => 'false'];
|
||||
list($foo, $bar, $true, $false) = $this->controller->bindActionParams($aksi1, $params);
|
||||
$this->assertSame(100, $foo);
|
||||
$this->assertSame(null, $bar);
|
||||
$this->assertSame(true, $true);
|
||||
$this->assertSame(false, $false);
|
||||
|
||||
$params = ['foo' => 'oops', 'bar' => null];
|
||||
$this->expectException('yii\web\BadRequestHttpException');
|
||||
|
Reference in New Issue
Block a user