1
0
mirror of https://github.com/e107inc/e107.git synced 2025-10-12 21:45:11 +02:00
Files
php-e107/tests/_support/Helper/DeployerFactory.php
Nick Liu b5b59392eb Started a basic interface to manipulate files in acceptance tests
- MOD: Renamed lib/deployers/cpanel_deployer.php to
       lib/deployers/cPanelDeployer.php
- MOD: Moved responsibility of reconfiguring Codeception modules to the
       deployers.
- NEW: Abstract class Deployer to standardize the interface to Deployers
- NEW: Acceptance tests now support unlinkE107ConfigFromTestEnvironment
- MOD: Removed null checks for the Deployer in the Base Module
- MOD: Improved public method naming in the Base Module
- MOD: DeployerFactory always returns a Deployer implementation now.
- MOD: InstallCest always clears out the e107_config.php file before
       each test.
2018-08-14 16:03:30 -05:00

38 lines
764 B
PHP

<?php
namespace Helper;
$deployers_path = __DIR__ . "/../../../lib/deployers";
include_once("{$deployers_path}/Deployer.php");
foreach (glob("{$deployers_path}/*.php") as $path)
{
include_once($path);
}
// here you can define custom actions
// all public methods declared in helper class will be available in $I
class DeployerFactory extends \Codeception\Module
{
/**
* @return \Deployer
*/
public function create()
{
return $this->createFromSecrets($this->config['secrets']);
}
/**
* @param $secrets
* @return \Deployer
*/
public function createFromSecrets($secrets)
{
$deployer = new \DummyDeployer();
if ($secrets['cpanel']['enabled'] === '1')
{
$deployer = new \cPanelDeployer($secrets['cpanel']);
}
return $deployer;
}
}