File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 22
33namespace Codeception \Module ;
44
5+ use Codeception \Lib \Interfaces \RequiresPackage ;
56use Codeception \Module as CodeceptionModule ;
67use Codeception \TestCase ;
78use Codeception \Exception \ModuleException ;
3132 *
3233 * @author Marc Verney <[email protected] > 3334 */
34- class Redis extends CodeceptionModule
35+ class Redis extends CodeceptionModule implements RequiresPackage
3536{
3637 /**
3738 * {@inheritdoc}
@@ -59,16 +60,18 @@ class Redis extends CodeceptionModule
5960 */
6061 public $ driver ;
6162
63+ public function _requires ()
64+ {
65+ return ['Predis\Client ' => '"predis/predis": "^1.0" ' ];
66+ }
67+
6268 /**
6369 * Instructions to run after configuration is loaded
6470 *
6571 * @throws ModuleException
6672 */
6773 public function _initialize ()
6874 {
69- if (!class_exists ('Predis\Client ' )) {
70- throw new ModuleException ($ this , 'This module requires Predis library to be installed. Please add "predis/predis": "^1.0" to composer.json ' );
71- }
7275 try {
7376 $ this ->driver = new RedisDriver ([
7477 'host ' => $ this ->config ['host ' ],
You can’t perform that action at this time.
0 commit comments