Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Fixture with Enum always sets the default Value


Go to End


3 Posts   1219 Views

Avatar
Andre

Community Member, 146 Posts

24 November 2015 at 11:41am

Hi there,

I have written some tests with fixtures for some modules I'm working on.

I stubled uppon a strange behaviour.
When setting the Values for some Enum Fields in my Fixtures, these values will be ignored and the enums default value is chosen instead.

Has anybody came across the same error and might can offer a solution?

Avatar
martimiz

Forum Moderator, 1391 Posts

25 November 2015 at 1:02am

I've not a lot of experience with testing, so I can't confirm, sorry. But I just wanted to say that if you feel this is a bug, please post it on Github as an issue for the framework.

Avatar
Andre

Community Member, 146 Posts

25 November 2015 at 1:25am

Hi, sorry, I should have responded to my post earlier.

I did some more testing yesterday and you are right. Fixtures for enums are working.

But:
There seem to be a few reserved words I didn't knew. My Enum Attribute was called "Status" (the column name, not the value) and that didn't worked. When I renamed it to "State" instead all was working fine.

kind regards