mirror of
https://github.com/e107inc/e107.git
synced 2025-08-29 17:19:56 +02:00
PHP 8.4 support and dynamic loading of plugin tests (WIP)
This commit is contained in:
@@ -57,8 +57,8 @@ abstract class Base extends \Codeception\Module
|
||||
}
|
||||
}
|
||||
|
||||
public function _before(\Codeception\TestInterface $test = null)
|
||||
public function _before(?\Codeception\TestInterface $test = null)
|
||||
{
|
||||
$this->_callbackDeployerStarted();
|
||||
$this->_callbackDeployerStarted();
|
||||
}
|
||||
}
|
||||
|
@@ -1,54 +1,44 @@
|
||||
<?php
|
||||
namespace Helper;
|
||||
|
||||
// here you can define custom actions
|
||||
// all public methods declared in helper class will be available in $I
|
||||
|
||||
class DelayedDb extends \Codeception\Module\Db
|
||||
{
|
||||
protected $requiredFields = [];
|
||||
protected array $requiredFields = ['dsn', 'user', 'password']; // Enforce required config
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
// Noop
|
||||
}
|
||||
public function _initialize(): void
|
||||
{
|
||||
// Call parent directly instead of deferring
|
||||
parent::_initialize();
|
||||
codecept_debug("DelayedDb initialized with DSN: " . $this->config['dsn']);
|
||||
}
|
||||
|
||||
public function _delayedInitialize()
|
||||
{
|
||||
return parent::_initialize();
|
||||
}
|
||||
// Keep this for manual triggering if needed
|
||||
public function _delayedInitialize()
|
||||
{
|
||||
return parent::_initialize();
|
||||
}
|
||||
|
||||
public function _getDbHostname()
|
||||
{
|
||||
$matches = [];
|
||||
$matched = preg_match('~host=([^;]+)~s', $this->config['dsn'], $matches);
|
||||
if (!$matched)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public function _getDbHostname()
|
||||
{
|
||||
$matches = [];
|
||||
$matched = preg_match('~host=([^;]+)~s', $this->config['dsn'], $matches);
|
||||
return $matched ? $matches[1] : false;
|
||||
}
|
||||
|
||||
return $matches[1];
|
||||
}
|
||||
public function _getDbName()
|
||||
{
|
||||
$matches = [];
|
||||
$matched = preg_match('~dbname=([^;]+)~s', $this->config['dsn'], $matches);
|
||||
return $matched ? $matches[1] : false;
|
||||
}
|
||||
|
||||
public function _getDbName()
|
||||
{
|
||||
$matches = [];
|
||||
$matched = preg_match('~dbname=([^;]+)~s', $this->config['dsn'], $matches);
|
||||
if (!$matched)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public function _getDbUsername()
|
||||
{
|
||||
return $this->config['user'];
|
||||
}
|
||||
|
||||
return $matches[1];
|
||||
}
|
||||
|
||||
public function _getDbUsername()
|
||||
{
|
||||
return $this->config['user'];
|
||||
}
|
||||
|
||||
public function _getDbPassword()
|
||||
{
|
||||
return $this->config['password'];
|
||||
}
|
||||
}
|
||||
public function _getDbPassword()
|
||||
{
|
||||
return $this->config['password'];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user