You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The argument passed to the VerifyThat classes' constructor can be one of the following:
A closure, as seen above - runs in the test class' context and has full access to $this
An instance method, e.g. 'method' - runs in the test class' context and has full access to $this
A class method, e.g. 'self::method' - runs in the test class' context and has full access to self
A foreign class' static method, e.g. '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
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: