Skip to content

Commit 7239430

Browse files
committed
Allow setting index in module configuration
1 parent 9cc856d commit 7239430

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
},
2020
"require": {
2121
"codeception/lib-innerbrowser": "dev-master",
22+
"codeception/codeception": "@dev",
2223
"symfony/browser-kit": ">=2.7 <5.0"
2324
}
2425
}

src/Codeception/Module/UniversalFramework.php

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
<?php
22
namespace Codeception\Module;
33

4-
class UniversalFramework extends \Codeception\Lib\Framework
4+
use Codeception\Configuration;
5+
use Codeception\Lib\Connector\Universal as Connector;
6+
use Codeception\Lib\Framework;
7+
8+
class UniversalFramework extends Framework
59
{
6-
public function __construct()
10+
11+
public function _initialize()
712
{
8-
$index = '/app/index.php';
9-
$this->client = new \Codeception\Lib\Connector\Universal();
10-
$this->client->setIndex(\Codeception\Configuration::dataDir().$index);
13+
if (isset($this->config['index'])) {
14+
$index = $this->config['index'];
15+
} else {
16+
$index = Configuration::dataDir() . '/app/index.php';
17+
}
18+
$this->client = new Connector();
19+
$this->client->setIndex($index);
1120
}
1221

1322
public function useUniversalFramework()

0 commit comments

Comments
 (0)