Fix #17929: Actions can now have bool typed params bound

This commit is contained in:
Alex
2020-03-24 15:44:43 +00:00
committed by GitHub
parent 31e3698ab9
commit 4b6d3c0290
4 changed files with 9 additions and 3 deletions

View File

@ -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');