1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +02:00

[task/session-tests] Added tests for the session class.

Two first simple tests to check functionality of session_begin and
session_create.

Added a mock class for the cache as well as a subclass of session
which has its cookie handling function mocked out to avoid header
sending problems.

PHPBB3-9732
This commit is contained in:
Nils Adermann
2011-01-04 17:14:36 +01:00
parent ba5c7d8e63
commit 74f537e89d
8 changed files with 344 additions and 1 deletions

View File

@@ -384,6 +384,17 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
return $db;
}
public function assertResultEquals($sql, $expected, $message = '')
{
$db = $this->new_dbal();
$result = $db->sql_query($sql);
$rows = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
$this->assertEquals($expected, $rows, $message);
}
public function setExpectedTriggerError($errno, $message = '')
{
$this->get_test_case_helpers()->setExpectedTriggerError($errno, $message);