aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDhruv <dhruv.goel92@gmail.com>2013-06-12 00:29:04 +0530
committerDhruv <dhruv.goel92@gmail.com>2013-10-05 21:15:19 +0530
commitea75b67f5e8986fe2cf36c88646bbb9db5da7893 (patch)
treeef425d0e64c90f860d9ba145396f6f5f041b8390 /tests
parente8c7f8134df38708e1af27325d2c8a7b9f28052e (diff)
downloadforums-ea75b67f5e8986fe2cf36c88646bbb9db5da7893.tar
forums-ea75b67f5e8986fe2cf36c88646bbb9db5da7893.tar.gz
forums-ea75b67f5e8986fe2cf36c88646bbb9db5da7893.tar.bz2
forums-ea75b67f5e8986fe2cf36c88646bbb9db5da7893.tar.xz
forums-ea75b67f5e8986fe2cf36c88646bbb9db5da7893.zip
[ticket/11608] add basic search functional test structure
PHPBB3-11608
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/search_test.php77
1 files changed, 77 insertions, 0 deletions
diff --git a/tests/functional/search_test.php b/tests/functional/search_test.php
new file mode 100644
index 0000000000..db3b63c230
--- /dev/null
+++ b/tests/functional/search_test.php
@@ -0,0 +1,77 @@
+<?php
+/**
+ *
+ * @package testing
+ * @copyright (c) 2013 phpBB Group
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+ *
+ */
+
+/**
+ * @group functional
+ */
+class phpbb_functional_search_test extends phpbb_functional_test_case
+{
+
+ public function test_native()
+ {
+ $this->search_backend_test('phpbb_search_fulltext_native');
+ }
+
+ public function test_mysql_fulltext()
+ {
+ $this->search_backend_test('phpbb_search_fulltext_mysql');
+
+ }
+
+ public function test_postgres_fulltext()
+ {
+ $this->search_backend_test('phpbb_search_fulltext_postgres');
+
+ }
+
+ public function test_sphinx()
+ {
+ $this->search_backend_test('phpbb_search_fulltext_sphinx');
+ }
+
+ public function search_found()
+ {
+
+ }
+
+ public function search_not_found()
+ {
+
+ }
+
+ protected function search_backend_test($search_backend)
+ {
+ $this->login();
+ $this->admin_login();
+
+ $crawler = self::request('GET', 'adm/index.php?i=acp_search&mode=settings&sid=' . $this->sid);
+ $form = $crawler->selectButton('Submit')->form();
+ $values = $form->getValues();
+
+ if ($values["config[search_type]"] != $search_backend)
+ {
+ $values["config[search_type]"] = $search_backend;
+ $form->setValues($values);
+ $crawler = self::submit($form);
+
+ $form = $crawler->selectButton('Yes')->form();
+ $values = $form->getValues();
+ $crawler = self::submit($form);
+
+ file_put_contents('log' . $search_backend . '.html', $crawler->text());
+ }
+
+ $this->create_search_index($search_backend);
+ }
+
+ protected function create_search_index($search_backend)
+ {
+
+ }
+}