Xtools

Categories

Component ID

1561346

Component name

Xtools

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Downloads

526

Component created

Component changed

Component body

Note: As of 15-01-2014, this module appears to no longer be supported. If you are interested in taking this module over, please reply to the issue.

Xtools helps developing and testing other modules. It offers several dynamic code analysis tools:

  • an API to compare data (variable, function return value, ...) to blueprints that define the structure that data should have.
  • an API to compare callables (functions, methods, or closures) to signatures that define what parameters those callables should accept and how.
  • an API to dynamically expose callables and define their parameters and return values using signatures and blueprints. Xtools comes with a number of definitions for Drupal core and several contributed modules.
  • test cases to easily test those callables against their blueprints and signatures. Use it to test your own modules by simply calling XtoolsWebTestCase::XtoolsAssertCallables().
  • test cases to test menu router items' and access callbacks' ability to perform access control.

Example use cases

  • Test if hook implementations and callbacks return the correct data and are implemented using the correct function signature.
  • Validate an entity's data structure using a blueprint.

For a simple example of this module's tests, see Xtools for Drupal core.

Modules that use Xtools

Xtools will not receive a Drupal 8 version. Its main feature, which is the blueprint API, is 'replaced' by Symfony2's validation constraints.