From 19a348e35990511186fc8e987b28b5f8b34c6650 Mon Sep 17 00:00:00 2001 From: Andy Chase Date: Wed, 26 Jun 2013 12:44:14 -0700 Subject: [PATCH] [ticket/11620] Add test for test_extract_current_page PHPBB3-11620 --- tests/session/class_functions_test.php | 49 ++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 tests/session/class_functions_test.php diff --git a/tests/session/class_functions_test.php b/tests/session/class_functions_test.php new file mode 100644 index 0000000000..c4ae5628f1 --- /dev/null +++ b/tests/session/class_functions_test.php @@ -0,0 +1,49 @@ +createXMLDataSet(dirname(__FILE__).'/fixtures/sessions_empty.xml'); + } + + public function setUp() + { + $this->session_factory = new phpbb_session_testable_factory; + $this->db = $this->new_dbal(); + } + + function test_extract_current_page() + { + $expected_fields = array( + 'page_name' => "index.php", + 'script_path' => "/phpBB/" + ); + + $output = phpbb_session_testable_facade::extract_current_page( + $this->db, + $this->session_factory, + /* Root Path */ "./", + /* PHP Self */ "/phpBB/index.php", + /* Query String*/ "", + /* Request URI */ "/phpBB/" + ); + + foreach($expected_fields as $field => $expected_value) + { + $this->assertSame($expected_value, $output[$field]); + } + } +}