-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Automatically populate data properties with passed parameters when onMount() isn't defined #132
Automatically populate data properties with passed parameters when onMount() isn't defined #132
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mrigsby Looks good! Would you be up for adding two tests for this commit, one that asserts the MissingOnMount exception and one that asserts that the data properties are actually set? If so, you can run the tests under http://localhost:60299/tests/ and the test needs to be added to test-harness/tests/specs/CBWIRESpec.cfc. You will see numerous examples and it's pretty straightforward integration testing. And if not, no worries, I can add it but it will probably be later this week.
Absolutely! Can do. I don't do enough testing... I gotta work on that! |
I created a few tests, more than two. In the process of testing I figured out that isStruct() returns true for a CFML component so I added the check for isObject() as well as isCustomFunction() while I was at it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @mrigsby ! Merging 🚀
Thank you!
26a9332
into
coldbox-modules:development
@grantcopley No problem at all. Thank you for all your hard work on cbwire, it's great. Glad I can contribute. |
@mrigsby Released in CBWIRE 3.2. https://www.ortussolutions.com/blog/cbwire-32-released Thank you for your contributions! |
Building on box products' love of conventions, if onMount() does not exist, we check that each parameter is a string, boolean, numeric, date, array, or struct and if they are we populate the component using scope population instead of setters.
#131