1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 13:17:24 +02:00
This commit is contained in:
Cameron
2019-02-07 17:11:36 -08:00
2 changed files with 8 additions and 2 deletions

View File

@@ -287,12 +287,16 @@
// Test 1
$expected = $db->update('tmp', array('tmp_ip' => '127.0.0.1', 'tmp_time' => time(), 'tmp_info' => 'test 1', 'WHERE' => 'tmp_ip="127.0.0.1"'));
$this->assertEmpty($expected, "Test update() failed (not empty {$expected})");
$this->assertEmpty($expected, "Test 1 update() failed (not empty {$expected})");
// Test 2
$actual = $db->insert('tmp', array('tmp_ip' => '127.0.0.1', 'tmp_time' => time(), 'tmp_info' => 'test 2'));
$expected = $db->update('tmp', array('tmp_ip' => '127.0.0.1', 'tmp_time' => time(), 'tmp_info' => 'test 2a', 'WHERE' => 'tmp_ip="127.0.0.1"'));
$this->assertEquals($actual, $expected, "Test update() failed ({$actual} != {$expected}");
$this->assertEquals(1, $expected, "Test 2 update() failed ({$actual} != {$expected}");
// Test 3
$expected = $db->update('tmp', 'tmp_ip = "127.0.0.1", tmp_time = tmp_time + 1, tmp_info = "test 3" WHERE tmp_ip="127.0.0.1"');
$this->assertEquals(1, $expected, "Test 3 update() failed ({$actual} != {$expected}");
}
/*

View File

@@ -15,6 +15,8 @@
protected function _before()
{
// fix for getperms("L") check in lancheck.php
define('ADMINPERMS', 'L');
require_once(e_ADMIN."lancheck.php");