-
Notifications
You must be signed in to change notification settings - Fork 1
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
Unittest closure actions #283
Labels
Milestone
Comments
Initial implementation exists in the rfc-283 branch |
Part of XP 6, see #172 |
thekid
added a commit
to xp-framework/unittest
that referenced
this issue
Aug 6, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Scope of Change
A new abstract base class will be added to enable inline test actions with a simple before-test verification.
Rationale
This will remove the necessity to introduce classes for really simple verify-and-it-not-ok-skip scenarios.
Functionality
Example:
New functionality
The argument passed to the
VerifyThat
classes' constructor can be one of the following:'method'
- runs in the test class' context and has full access to $this'self::method'
- runs in the test class' context and has full access to self'com.example.Coin::values'
.The callable will be invoked without arguments and if it returns FALSE, a
PrerequisitesNotMetError
will be thrown an the corresponding test(s) will be skipped.Security considerations
Speed impact
Dependencies
The
function
keyword needs to be supported inside the Class Parser. Currently this raises:Caused by Exception lang.IllegalStateException (Parse error: Unexpected T_FUNCTION) at lang.reflect.ClassParser::valueOf(array[32], 17, (0x13)'unittest.TestCase�5', array[0]) [line 159 of ClassParser.class.php] ... 17 more
See xp-framework/core#7
Related documents
The text was updated successfully, but these errors were encountered: