Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for array of enums #9497

Merged
merged 16 commits into from
Apr 4, 2022
Prev Previous commit
Next Next commit
Merge branch '2.12.x' into feature/enum-arrays
  • Loading branch information
sanderdlm committed Apr 4, 2022
commit 12fd73804061c59ea295162d3403f707d3fa65ac
13 changes: 13 additions & 0 deletions tests/Doctrine/Tests/ORM/Functional/EnumTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,17 @@ public function testEnumArrayMapping(): void
$this->assertContains(Unit::Gram, $fetchedScale->supportedUnits);
$this->assertContains(Unit::Meter, $fetchedScale->supportedUnits);
}

public function testEnumWithDefault(): void
{
$this->setUpEntitySchema([CardWithDefault::class]);

$table = $this->_em->getClassMetadata(CardWithDefault::class)->getTableName();
$cardId = uniqid('', true);

$this->_em->getConnection()->insert($table, ['id' => $cardId]);
$card = $this->_em->find(CardWithDefault::class, $cardId);

self::assertSame(Suit::Hearts, $card->suit);
}
}
You are viewing a condensed version of this merge commit. You can view the full changes here.