1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 06:38:00 +02:00

Whitelist specific folders for coverage. More PDO tests.

This commit is contained in:
Cameron
2019-02-11 11:34:58 -08:00
parent c8df79ea01
commit 360b6a15b0
2 changed files with 59 additions and 15 deletions

View File

@@ -11,7 +11,13 @@ coverage:
enabled: true enabled: true
include: include:
- '%app_path%/*.php' - '%app_path%/*.php'
- '%app_path%/**/*.php' - '%app_path%/e107_admin/**/*.php'
- '%app_path%/e107_core/**/*.php'
- '%app_path%/e107_handlers/**/*.php'
- '%app_path%/e107_images/**/*.php'
- '%app_path%/e107_plugins/**/*.php'
- '%app_path%/e107_themes/**/*.php'
- '%app_path%/e107_web/**/*.php'
params: params:
- lib/config.php - lib/config.php
extensions: extensions:

View File

@@ -91,13 +91,21 @@
} }
/** /**
* Test primary methods against a secondary database (ensures mysqlPrefix is working correctly) * @desc Test primary methods against a secondary database (ensures mysqlPrefix is working correctly)
* TODO Split into separate methods? Order needs to be respected.
*/ */
/*
public function testSecondaryDatabase() public function testSecondaryDatabase()
{ {
$xql = e107::getDb('newdb');
try
{
$xql = $this->make('e_db_pdo');
}
catch (Exception $e)
{
$this->fail("Couldn't load e_db_pdo object");
}
$xql->__construct();
$config = e107::getMySQLConfig(); $config = e107::getMySQLConfig();
$database = 'e107_tests_tmp'; $database = 'e107_tests_tmp';
@@ -183,7 +191,7 @@
// primary database retrieve // primary database retrieve
$username = e107::getDb()->retrieve('user','user_name', 'user_id = 1'); $username = $this->db->retrieve('user','user_name', 'user_id = 1');
$this->assertNotEmpty($username, "Lost connection with primary database."); $this->assertNotEmpty($username, "Lost connection with primary database.");
@@ -206,7 +214,7 @@
} }
*/
public function testGetServerInfo() public function testGetServerInfo()
@@ -494,6 +502,17 @@
} }
*/ */
public function testDb_QueryCount()
{
$this->db->select('user', '*');
$this->db->select('plugin','*');
$result = $this->db->db_QueryCount();
$this->assertEquals(2,$result);
}
public function testDb_UpdateArray() public function testDb_UpdateArray()
{ {
@@ -716,10 +735,16 @@
} }
*/ */
public function testIsTable() public function testDb_Table_exists()
{ {
$result = $this->db->isTable('plugin'); $result = $this->db->db_Table_exists('plugin');
$this->assertTrue($result); $this->assertTrue($result);
$result = $this->db->db_Table_exists('plugin', 'French');
$this->assertFalse($result);
$result = $this->db->db_Table_exists('plugin', 'English');
$this->assertFalse($result);
} }
public function testIsEmpty() public function testIsEmpty()
@@ -727,17 +752,29 @@
$result = $this->db->isEmpty('plugin'); $result = $this->db->isEmpty('plugin');
$this->assertFalse($result); $this->assertFalse($result);
} }
/*
public function testDb_ResetTableList() public function testDb_ResetTableList()
{ {
$this->db->Db_ResetTableList();
} }
public function testDb_TableList() public function testDb_TableList()
{ {
$list = $this->db->db_TableList();
$present = in_array('banlist', $list);
$this->assertTrue($present);
$list = $this->db->db_TableList('nologs');
$present = in_array('admin_log', $list);
$this->assertFalse($present);
$list = $this->db->db_TableList('lan');
$this->assertEmpty($list);
//var_dump($list);
} }
*/
public function testTables() public function testTables()
{ {
$list = $this->db->tables(); $list = $this->db->tables();
@@ -823,14 +860,15 @@
{ {
} }
*/
public function testDb_Set_Charset() public function testDb_ResetTableList()
{ {
$this->db->db_ResetTableList();
} }
public function testGetFieldDefs() public function testGetFieldDefs()
{ {
}*/ }
} }