1
0
mirror of https://github.com/e107inc/e107.git synced 2025-10-11 04:54:26 +02:00

Partial teardown functionality for cPanel deployer

Also renamed class Prepare_cPanel to cPanelDeployer
This commit is contained in:
Deltik
2018-02-07 05:28:52 -06:00
parent ee84c3de76
commit ba9a27787e
2 changed files with 37 additions and 17 deletions

View File

@@ -1,24 +1,31 @@
<?php
namespace Helper;
include_once(__DIR__ . "/../../../lib/prepare_cpanel.php");
include_once(__DIR__ . "/../../../lib/deployers/cpanel_deployer.php");
// here you can define custom actions
// all public methods declared in helper class will be available in $I
class Acceptance extends \Codeception\Module
{
protected $deployer;
public function _beforeSuite($settings = array())
{
$secrets = $settings['secrets'];
if ($secrets['cpanel']['enabled'] === '1')
{
$prepare = new \Prepare_cPanel($secrets['cpanel']);
$retcode = $prepare->start();
$this->deployer = new \cPanelDeployer($secrets['cpanel']);
$retcode = $this->deployer->start();
if ($retcode === true)
{
$domain = $prepare->getDomain();
$domain = $this->deployer->getDomain();
$this->getModule('PhpBrowser')->_reconfigure(array('url' => "http://${domain}"));
}
}
}
public function _afterSuite()
{
$this->deployer->stop();
}
}