1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-19 04:41:53 +02:00

Updating of deprecated method usage. Removal of old files. Log tests added.

This commit is contained in:
Cameron
2020-12-18 09:39:02 -08:00
parent 582c48fc21
commit f5153bf640
55 changed files with 509 additions and 3218 deletions

View File

@@ -28,6 +28,7 @@
$this->assertTrue(false, "Couldn't load e_admin_log object");
}
$this->log->__construct();
}
/*
public function testAddSuccess()
@@ -54,12 +55,20 @@
{
}
*/
public function testAddArray()
{
$arr = array('one'=>'two', 'three'=>'four');
$this->log->addArray($arr)->save('ADD_ARRAY');
$result = $this->log->getLastLog();
$this->assertNotEmpty($result['dblog_eventcode']);
$this->assertSame('ADD_ARRAY', $result['dblog_eventcode']);
$this->assertSame("Array[!br!]([!br!] [one] => two[!br!] [three] => four[!br!])[!br!]",$result['dblog_remarks']);
}
/*
public function testLogMessage()
{
@@ -84,12 +93,21 @@
{
}
*/
public function testLogArrayAll()
{
$arr = array('one'=>'test', 'two'=>'testing');
$this->log->logArrayAll('TEST',$arr);
$result = $this->log->getLastLog();
$this->assertNotEmpty($result['dblog_eventcode']);
$this->assertSame('TEST', $result['dblog_eventcode']);
$this->assertSame("Array[!br!]([!br!] [one] => test[!br!] [two] => testing[!br!])[!br!]", $result['dblog_remarks']);
}
/*
public function testFlushMessages()
{
@@ -104,12 +122,32 @@
{
}
*/
public function testAdd()
{
// add to admin_log
$this->log->add('testAdd Title', "testAdd Message", E_LOG_INFORMATIVE, 'TEST_ADD');
$result = $this->log->getLastLog();
$this->assertNotEmpty($result['dblog_eventcode']);
$this->assertSame('TEST_ADD', $result['dblog_eventcode']);
$this->assertSame("testAdd Message", $result['dblog_remarks']);
$this->assertSame('testAdd Title', $result['dblog_title']);
// add to rolling log (dblog)
$this->log->rollingLog(true);
$this->log->add('Rolling Title', "Rolling Message", E_LOG_INFORMATIVE, 'TEST_ROLL', LOG_TO_ROLLING);
$result = $this->log->getLastLog(LOG_TO_ROLLING);
$this->assertNotEmpty($result['dblog_eventcode']);
$this->assertSame('TEST_ROLL', $result['dblog_eventcode']);
$this->assertSame("Rolling Message", $result['dblog_remarks']);
$this->log->rollingLog(false);
}
/*
public function testToFile()
{