mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-30 03:30:17 +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:
19
tests/session/fixtures/sessions_empty.xml
Normal file
19
tests/session/fixtures/sessions_empty.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<dataset>
|
||||
<table name="phpbb_users">
|
||||
<column>user_id</column>
|
||||
<column>username_clean</column>
|
||||
<row>
|
||||
<value>1</value>
|
||||
<value>anonymous</value>
|
||||
</row>
|
||||
<row>
|
||||
<value>3</value>
|
||||
<value>foo</value>
|
||||
</row>
|
||||
<row>
|
||||
<value>4</value>
|
||||
<value>bar</value>
|
||||
</row>
|
||||
</table>
|
||||
</dataset>
|
37
tests/session/fixtures/sessions_full.xml
Normal file
37
tests/session/fixtures/sessions_full.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<dataset>
|
||||
<table name="phpbb_users">
|
||||
<column>user_id</column>
|
||||
<column>username_clean</column>
|
||||
<row>
|
||||
<value>1</value>
|
||||
<value>anonymous</value>
|
||||
</row>
|
||||
<row>
|
||||
<value>3</value>
|
||||
<value>foo</value>
|
||||
</row>
|
||||
<row>
|
||||
<value>4</value>
|
||||
<value>bar</value>
|
||||
</row>
|
||||
</table>
|
||||
<table name="phpbb_sessions">
|
||||
<column>session_id</column>
|
||||
<column>session_user_id</column>
|
||||
<column>session_ip</column>
|
||||
<column>session_browser</column>
|
||||
<row>
|
||||
<value>anon_session</value>
|
||||
<value>1</value>
|
||||
<value>127.0.0.1</value>
|
||||
<value>anonymous user agent</value>
|
||||
</row>
|
||||
<row>
|
||||
<value>bar_session</value>
|
||||
<value>4</value>
|
||||
<value>127.0.0.1</value>
|
||||
<value>user agent</value>
|
||||
</row>
|
||||
</table>
|
||||
</dataset>
|
Reference in New Issue
Block a user