diff options
author | asperous <asperous2@gmail.com> | 2013-07-11 14:58:41 -0700 |
---|---|---|
committer | Andy Chase <asperous2@gmail.com> | 2013-07-22 10:53:52 -0700 |
commit | 62d7a0570071bb572fa60e502596d21eaee57376 (patch) | |
tree | 5f83b670b7d45048f95cd0bc034b12a8028b8a50 /tests/session | |
parent | c96b0b1a47cef409fecc3bd30792e0907a869baa (diff) | |
download | forums-62d7a0570071bb572fa60e502596d21eaee57376.tar forums-62d7a0570071bb572fa60e502596d21eaee57376.tar.gz forums-62d7a0570071bb572fa60e502596d21eaee57376.tar.bz2 forums-62d7a0570071bb572fa60e502596d21eaee57376.tar.xz forums-62d7a0570071bb572fa60e502596d21eaee57376.zip |
[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
Diffstat (limited to 'tests/session')
-rw-r--r-- | tests/session/create_test.php | 16 | ||||
-rw-r--r-- | tests/session/extract_hostname_test.php | 16 | ||||
-rw-r--r-- | tests/session/extract_page_test.php | 16 | ||||
-rw-r--r-- | tests/session/validate_referrer_test.php | 16 |
4 files changed, 8 insertions, 56 deletions
diff --git a/tests/session/create_test.php b/tests/session/create_test.php index 4a7484321c..a8248ae62c 100644 --- a/tests/session/create_test.php +++ b/tests/session/create_test.php @@ -7,27 +7,15 @@ * */ -require_once dirname(__FILE__) . '/testable_facade.php'; +require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php'; -class phpbb_session_create_test extends phpbb_database_test_case +class phpbb_session_create_test extends phpbb_session_test_case { - public $session_factory; - public $db; - public $session_facade; - public function getDataSet() { return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/sessions_full.xml'); } - public function 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); - } - static function bot($bot_agent, $user_id, $bot_ip) { return array(array( diff --git a/tests/session/extract_hostname_test.php b/tests/session/extract_hostname_test.php index cd71f82b17..5ff43cbb60 100644 --- a/tests/session/extract_hostname_test.php +++ b/tests/session/extract_hostname_test.php @@ -7,27 +7,15 @@ * */ -require_once dirname(__FILE__) . '/testable_facade.php'; +require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php'; -class phpbb_session_extract_hostname_test extends phpbb_database_test_case +class phpbb_session_extract_hostname_test extends phpbb_session_test_case { - public $session_factory; - public $db; - public $session_facade; - public function getDataSet() { return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/sessions_empty.xml'); } - public function 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); - } - static public function extract_current_hostname_data() { return array ( diff --git a/tests/session/extract_page_test.php b/tests/session/extract_page_test.php index c17845526f..9346973bc4 100644 --- a/tests/session/extract_page_test.php +++ b/tests/session/extract_page_test.php @@ -7,27 +7,15 @@ * */ -require_once dirname(__FILE__) . '/testable_facade.php'; +require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php'; -class phpbb_session_extract_page_test extends phpbb_database_test_case +class phpbb_session_extract_page_test extends phpbb_session_test_case { - public $session_factory; - public $db; - public $session_facade; - public function getDataSet() { return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/sessions_empty.xml'); } - public function 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); - } - static public function extract_current_page_data() { return array( diff --git a/tests/session/validate_referrer_test.php b/tests/session/validate_referrer_test.php index 1428187f27..f91ac5f1f9 100644 --- a/tests/session/validate_referrer_test.php +++ b/tests/session/validate_referrer_test.php @@ -7,27 +7,15 @@ * */ -require_once dirname(__FILE__) . '/testable_facade.php'; +require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php'; -class phpbb_session_validate_referrer_test extends phpbb_database_test_case +class phpbb_session_validate_referrer_test extends phpbb_session_test_case { - public $session_factory; - public $db; - public $session_facade; - public function getDataSet() { return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/sessions_empty.xml'); } - public function 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); - } - static function referrer_inputs() { $ex = "example.org"; $alt = "example.com"; |