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.jsonand thelibraryfolder, from the ZIP file, are located atsites/[SITE NAME]/libraries/hamcrest/composer.jsonandsites/[SITE NAME]/libraries/hamcrest/libraryrespectively. - Mockery installed so that
composer.jsonand thelibraryfolder, from the ZIP file, are located atsites/[SITE NAME]/libraries/mockery/composer.jsonandsites/[SITE NAME]/libraries/mockery/libraryrespectively.
- Hamcrest installed so that
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:
- #1525484: Make libraries available at boot so that Mockery and Hamcrest can load via Libraries during site boot.
- #2870199: Update to work with latest Drupal 7 and Mockery conventions to fix the order in which code loads, and make the Mockery module compatible with the latest Mockery PHP library.
Installation and Usage
- Install the modules and libraries as described under the Requirements section above.
- When crafting SimpleTest test cases, ensure that
hammockis one of the modules you enable during the test set-up. - Follow Mockery's Getting Started guide for how to set-up and tear-down mocks.
