Hammock

Categories

Component ID

2870229

Component name

Hammock

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

This module wraps the Hamcrest and Mockery PHP testing libraries using the Libraries API.

Requirements

  • The following modules:
  • The following libraries:
    • Hamcrest installed so that composer.json and the library folder, from the ZIP file, are located at sites/[SITE NAME]/libraries/hamcrest/composer.json and sites/[SITE NAME]/libraries/hamcrest/library respectively.
    • Mockery installed so that composer.json and the library folder, from the ZIP file, are located at sites/[SITE NAME]/libraries/mockery/composer.json and sites/[SITE NAME]/libraries/mockery/library respectively.

Complementary Modules

This module was written to complement & extend the Mockery sandbox module for use with Drupal SimpleTest, although this module does not strictly depend on that module. By using the Libraries API, this module frees you from having to use Composer; you will need to download the libraries manually.

If using this module with the Mockery module, you will want to apply the following patches:

Installation and Usage

  1. Install the modules and libraries as described under the Requirements section above.
  2. When crafting SimpleTest test cases, ensure that hammock is one of the modules you enable during the test set-up.
  3. Follow Mockery's Getting Started guide for how to set-up and tear-down mocks.