mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 14:46:56 +02:00
Un-hard-coded database name and table prefix in e_db_pdoTest
Also corrected a typo that switched an expected and actual assertion arguments.
This commit is contained in:
2
e107
2
e107
Submodule e107 updated: 08f7a5d766...f5f2212b54
@@ -10,7 +10,7 @@ use Codeception\Lib\ModuleContainer;
|
|||||||
abstract class E107Base extends Base
|
abstract class E107Base extends Base
|
||||||
{
|
{
|
||||||
const APP_PATH_E107_CONFIG = APP_PATH."/e107_config.php";
|
const APP_PATH_E107_CONFIG = APP_PATH."/e107_config.php";
|
||||||
public $e107_mySQLprefix = 'e107_';
|
const E107_MYSQL_PREFIX = 'e107_';
|
||||||
protected $preparer = null;
|
protected $preparer = null;
|
||||||
|
|
||||||
public function __construct(ModuleContainer $moduleContainer, $config = null)
|
public function __construct(ModuleContainer $moduleContainer, $config = null)
|
||||||
@@ -49,7 +49,7 @@ abstract class E107Base extends Base
|
|||||||
$e107_config['mySQLuser'] = $db->_getDbUsername();
|
$e107_config['mySQLuser'] = $db->_getDbUsername();
|
||||||
$e107_config['mySQLpassword'] = $db->_getDbPassword();
|
$e107_config['mySQLpassword'] = $db->_getDbPassword();
|
||||||
$e107_config['mySQLdefaultdb'] = $db->_getDbName();
|
$e107_config['mySQLdefaultdb'] = $db->_getDbName();
|
||||||
$e107_config['mySQLprefix'] = $this->e107_mySQLprefix;
|
$e107_config['mySQLprefix'] = self::E107_MYSQL_PREFIX;
|
||||||
|
|
||||||
$e107_config_contents = $twig->render('e107_config.php', $e107_config);
|
$e107_config_contents = $twig->render('e107_config.php', $e107_config);
|
||||||
file_put_contents(self::APP_PATH_E107_CONFIG, $e107_config_contents);
|
file_put_contents(self::APP_PATH_E107_CONFIG, $e107_config_contents);
|
||||||
|
@@ -119,7 +119,8 @@
|
|||||||
|
|
||||||
$result = $this->db->database($this->dbConfig['mySQLdefaultdb'], MPREFIX, true);
|
$result = $this->db->database($this->dbConfig['mySQLdefaultdb'], MPREFIX, true);
|
||||||
$this->assertTrue($result);
|
$this->assertTrue($result);
|
||||||
$this->assertEquals("`e107_tests`.e107_", $this->db->mySQLPrefix);
|
$this->assertEquals("`".$this->dbConfig["mySQLdefaultdb"]."`.".\Helper\Unit::E107_MYSQL_PREFIX,
|
||||||
|
$this->db->mySQLPrefix);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -197,7 +198,7 @@
|
|||||||
'dblog_user_id' => '1',
|
'dblog_user_id' => '1',
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertEquals($data, $expected);
|
$this->assertEquals($expected, $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user