1
0
mirror of https://github.com/e107inc/e107.git synced 2025-10-09 03:56:24 +02:00
Files
php-e107/e107_tests/tests/_support/Helper/Base.php
Nick Liu 3b4240bbae Quality control for e_file::unzipGithubArchive()
- MOD: PHPDoc for e_file::unzipGithubArchive()
- NEW: e_file::unzipGithubArchive(): Added exclusions for files that don't exist in production
- NEW: e_file::unzipGithubArchive(): Accept a destination path argument for a custom extraction location
- NEW: Restored unimplemented skipped list in e_file::unzipGithubArchive()
- FIX: e_file::unzipGithubArchive(): Extraction fails if parent directory of file doesn't exist
- MOD: Type hint for Base::$deployer
- NEW: Basic test for e_file::unzipGithubArchive()
2019-12-27 11:33:21 -06:00

65 lines
1.3 KiB
PHP

<?php
namespace Helper;
include_once(codecept_root_dir() . "lib/deployers/DeployerFactory.php");
// here you can define custom actions
// all public methods declared in helper class will be available in $I
abstract class Base extends \Codeception\Module
{
/**
* @var \Deployer
*/
protected $deployer;
protected $deployer_components = ['db', 'fs'];
public function getDbModule()
{
return $this->getModule('\Helper\DelayedDb');
}
public function getBrowserModule()
{
return $this->getModule('PhpBrowser');
}
public function _beforeSuite($settings = array())
{
$this->deployer = \DeployerFactory::create();
$this->deployer->setComponents($this->deployer_components);
$this->deployer->start();
$this->_callbackDeployerStarted();
foreach ($this->getModules() as $module)
{
if (!$module instanceof $this)
{
$module->_beforeSuite();
}
}
}
public function _afterSuite()
{
$this->deployer->stop();
}
protected function _callbackDeployerStarted()
{
foreach ($this->deployer_components as $component)
{
$method = "reconfigure_${component}";
if (method_exists($this->deployer, $method))
{
$this->deployer->$method($this);
}
}
}
public function _before(\Codeception\TestCase $test = null)
{
$this->_callbackDeployerStarted();
}
}