mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 05:50:42 +02:00
[ticket/11620] Abstracted session setUp into a test_case class
When defining a database test case with a setUp function, it is important to call the parent's setup function, because that is when the database is setup. PHPBB3-11620
This commit is contained in:
27
tests/test_framework/phpbb_session_test_case.php
Normal file
27
tests/test_framework/phpbb_session_test_case.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* @package testing
|
||||
* @copyright (c) 2013 phpBB Group
|
||||
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
|
||||
*
|
||||
*/
|
||||
|
||||
require_once dirname(__FILE__) . '/../session/testable_factory.php';
|
||||
require_once dirname(__FILE__) . '/../session/testable_facade.php';
|
||||
|
||||
abstract class phpbb_session_test_case extends phpbb_database_test_case
|
||||
{
|
||||
protected $session_factory;
|
||||
protected $session_facade;
|
||||
protected $db;
|
||||
|
||||
function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
$this->session_factory = new phpbb_session_testable_factory;
|
||||
$this->db = $this->new_dbal();
|
||||
$this->session_facade =
|
||||
new phpbb_session_testable_facade($this->db, $this->session_factory);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user