1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 20:00:37 +02:00

debug test class added. More pdo tests.

This commit is contained in:
Cameron
2019-02-10 15:02:14 -08:00
parent b07b24b207
commit d84c8880bd
2 changed files with 156 additions and 4 deletions

View File

@@ -0,0 +1,138 @@
<?php
/**
* Created by PhpStorm.
* User: Wiz
* Date: 2/10/2019
* Time: 2:21 PM
*/
class e107_db_debugTest extends \Codeception\Test\Unit
{
/** @var e107_db_debug */
protected $dbg;
protected function _before()
{
try
{
$this->dbg = $this->make('e107_db_debug');
}
catch(Exception $e)
{
$this->assertTrue(false, "Couldn't load e107_db_debug object");
}
}
/*
public function testShowIf()
{
}
public function testShow_Log()
{
}
public function testShow_Includes()
{
}
public function testSave()
{
}
public function testShow_DEPRECATED()
{
}*/
public function testLog()
{
define('E107_DBG_BASIC', true); // fails , already defined?
$res = $this->dbg->log('hello world');
$this->assertTrue($res, 'db_debug->log() method returned false.');
$result = $this->dbg->Show_Log();
// var_dump($result);
}
/*
public function testLogCode()
{
}
public function testLogDeprecated()
{
}
public function test__construct()
{
}
public function testE107_db_debug()
{
}
public function testShow_SQL_Details()
{
}
public function testShow_SC_BB()
{
}
public function testShow_All()
{
}
public function testCountLabel()
{
}
public function testMark_Time()
{
}
public function testMark_Query()
{
}
public function testShow_Performance()
{
}
public function testShow_PATH()
{
}
public function testDump()
{
}
*/
}

View File

@@ -683,7 +683,8 @@
{
}
*//*
*/
public function testBackup()
{
$opts = array(
@@ -702,28 +703,41 @@
$this->assertContains("CREATE TABLE `e107_core_media_cat`", $tmp);
}*/
}
/*
public function testDbError()
{
}
*/
public function testGetLastErrorNumber()
{
$this->db->select('doesnt_exists');
$result = $this->db->getLastErrorNumber();
$this->assertEquals("42S02", $result);
}
public function testGetLastErrorText()
{
$this->db->select('doesnt_exists');
$result = $this->db->getLastErrorText();
$actual = (strpos($result,"doesn't exist")!== false );
$this->assertTrue($actual);
}
public function testResetLastError()
{
$this->db->select('doesnt_exists');
$this->db->resetLastError();
$num = $this->db->getLastErrorNumber();
$this->assertEquals(0, $num);
}
/*
public function testGetLastQuery()
{