mirror of
https://github.com/friendica/friendica
synced 2025-04-26 09:50:15 +00:00
Introduce test optimization
- Add static connection for whole tests - Introduce ExtendedPDO class to enable nested transactions - Add rollback logic for tests to ensure reliability and increase speed
This commit is contained in:
parent
07aaf292ec
commit
37d03bbeae
5 changed files with 246 additions and 50 deletions
|
@ -21,29 +21,29 @@ use Psr\Log\LoggerInterface;
|
|||
*/
|
||||
class Database
|
||||
{
|
||||
private $connected = false;
|
||||
protected $connected = false;
|
||||
|
||||
/**
|
||||
* @var ConfigCache
|
||||
*/
|
||||
private $configCache;
|
||||
protected $configCache;
|
||||
/**
|
||||
* @var Profiler
|
||||
*/
|
||||
private $profiler;
|
||||
protected $profiler;
|
||||
/**
|
||||
* @var LoggerInterface
|
||||
*/
|
||||
private $logger;
|
||||
private $server_info = '';
|
||||
protected $logger;
|
||||
protected $server_info = '';
|
||||
/** @var PDO|mysqli */
|
||||
private $connection;
|
||||
private $driver;
|
||||
protected $connection;
|
||||
protected $driver;
|
||||
private $error = false;
|
||||
private $errorno = 0;
|
||||
private $affected_rows = 0;
|
||||
private $in_transaction = false;
|
||||
private $in_retrial = false;
|
||||
protected $in_transaction = false;
|
||||
protected $in_retrial = false;
|
||||
private $relation = [];
|
||||
|
||||
public function __construct(ConfigCache $configCache, Profiler $profiler, LoggerInterface $logger, array $server = [])
|
||||
|
@ -1070,7 +1070,7 @@ class Database
|
|||
return true;
|
||||
}
|
||||
|
||||
private function performCommit()
|
||||
protected function performCommit()
|
||||
{
|
||||
switch ($this->driver) {
|
||||
case 'pdo':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue