Skip to content

Commit

Permalink
Merge pull request #20296 from briedis/master
Browse files Browse the repository at this point in the history
Fix enum test. Value used in assertion did not match the actual enum name
  • Loading branch information
mtangoo authored Dec 10, 2024
2 parents 4ea0575 + b761bef commit dd4efda
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions framework/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------------------
Expand Down
2 changes: 1 addition & 1 deletion tests/framework/db/CommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1539,7 +1539,7 @@ public function testBindValuesSupportsEnums()
$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']);
Expand Down

0 comments on commit dd4efda

Please sign in to comment.