Merge pull request #20296 from briedis/master

Fix enum test. Value used in assertion did not match the actual enum name
This commit is contained in:
Stefano D. Mtangoo
2024-12-10 14:03:41 +03:00
committed by GitHub
2 changed files with 2 additions and 1 deletions

View File

@ -22,6 +22,7 @@ Yii Framework 2 Change Log
- Bug #20140: Fix compatibility with PHP 8.4: calling `session_set_save_handler()` (Izumi-kun)
- New #20185: Add `BackedEnum` support to `AttributeTypecastBehavior` (briedis)
- Bug #17365: Fix "Trying to access array offset on null" warning (xcopy)
- Bug #20296: Fix broken enum test (briedis)
2.0.51 July 18, 2024
--------------------

View File

@ -1539,7 +1539,7 @@ SQL;
$command = $db->createCommand();
$command->setSql('SELECT :p1')->bindValues([':p1' => enums\Status::Active]);
$this->assertSame('ACTIVE', $command->params[':p1']);
$this->assertSame('Active', $command->params[':p1']);
$command->setSql('SELECT :p1')->bindValues([':p1' => enums\StatusTypeString::Active]);
$this->assertSame('active', $command->params[':p1']);