mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-29 06:38:52 +00:00
[ticket/10586] Adding the extensions used by the tests
PHPBB3-10586
This commit is contained in:
parent
a37a28b485
commit
d235262bc2
13 changed files with 137 additions and 6 deletions
17
tests/functional/fixtures/ext/error/class/controller.php
Normal file
17
tests/functional/fixtures/ext/error/class/controller.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
class phpbb_ext_foobar_controller implements phpbb_extension_controller_interface
|
||||
{
|
||||
public function handle()
|
||||
{
|
||||
global $template;
|
||||
$template->set_ext_dir_prefix($phpbb_root_path . 'ext/error/class/');
|
||||
|
||||
$template->set_filenames(array(
|
||||
'body' => 'index_body.html'
|
||||
));
|
||||
|
||||
page_header('Test extension');
|
||||
page_footer();
|
||||
}
|
||||
}
|
6
tests/functional/fixtures/ext/error/class/ext.php
Normal file
6
tests/functional/fixtures/ext/error/class/ext.php
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
|
||||
class phpbb_ext_error_class_ext extends phpbb_extension_base
|
||||
{
|
||||
|
||||
}
|
17
tests/functional/fixtures/ext/error/classtype/controller.php
Normal file
17
tests/functional/fixtures/ext/error/classtype/controller.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
class phpbb_ext_error_classtype_controller
|
||||
{
|
||||
public function handle()
|
||||
{
|
||||
global $template;
|
||||
$template->set_ext_dir_prefix($phpbb_root_path . 'ext/error/classtype/');
|
||||
|
||||
$template->set_filenames(array(
|
||||
'body' => 'index_body.html'
|
||||
));
|
||||
|
||||
page_header('Test extension');
|
||||
page_footer();
|
||||
}
|
||||
}
|
6
tests/functional/fixtures/ext/error/classtype/ext.php
Normal file
6
tests/functional/fixtures/ext/error/classtype/ext.php
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
|
||||
class phpbb_ext_error_classtype_ext extends phpbb_extension_base
|
||||
{
|
||||
|
||||
}
|
17
tests/functional/fixtures/ext/error/disabled/controller.php
Normal file
17
tests/functional/fixtures/ext/error/disabled/controller.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
class phpbb_ext_error_disabled_controller implements phpbb_extension_controller_interface
|
||||
{
|
||||
public function handle()
|
||||
{
|
||||
global $template;
|
||||
$template->set_ext_dir_prefix($phpbb_root_path . 'ext/error/disabled/');
|
||||
|
||||
$template->set_filenames(array(
|
||||
'body' => 'index_body.html'
|
||||
));
|
||||
|
||||
page_header('Test extension');
|
||||
page_footer();
|
||||
}
|
||||
}
|
6
tests/functional/fixtures/ext/error/disabled/ext.php
Normal file
6
tests/functional/fixtures/ext/error/disabled/ext.php
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
|
||||
class phpbb_ext_error_disabled_ext extends phpbb_extension_base
|
||||
{
|
||||
|
||||
}
|
17
tests/functional/fixtures/ext/foo/bar/controller.php
Normal file
17
tests/functional/fixtures/ext/foo/bar/controller.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
class phpbb_ext_foo_bar_controller implements phpbb_extension_controller_interface
|
||||
{
|
||||
public function handle()
|
||||
{
|
||||
global $template;
|
||||
$template->set_ext_dir_prefix($phpbb_root_path . 'ext/foo/bar/');
|
||||
|
||||
$template->set_filenames(array(
|
||||
'body' => 'index_body.html'
|
||||
));
|
||||
|
||||
page_header('Test extension');
|
||||
page_footer();
|
||||
}
|
||||
}
|
6
tests/functional/fixtures/ext/foo/bar/ext.php
Normal file
6
tests/functional/fixtures/ext/foo/bar/ext.php
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
|
||||
class phpbb_ext_foo_bar_ext extends phpbb_extension_base
|
||||
{
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
<!-- INCLUDE overall_header.html -->
|
||||
|
||||
<div id="welcome">This is for testing purposes.</div>
|
||||
|
||||
<!-- INCLUDE overall_footer.html -->
|
17
tests/functional/fixtures/ext/foobar/controller.php
Normal file
17
tests/functional/fixtures/ext/foobar/controller.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
class phpbb_ext_foobar_controller implements phpbb_extension_controller_interface
|
||||
{
|
||||
public function handle()
|
||||
{
|
||||
global $template;
|
||||
$template->set_ext_dir_prefix($phpbb_root_path . 'ext/foobar/');
|
||||
|
||||
$template->set_filenames(array(
|
||||
'body' => 'index_body.html'
|
||||
));
|
||||
|
||||
page_header('Test extension');
|
||||
page_footer();
|
||||
}
|
||||
}
|
6
tests/functional/fixtures/ext/foobar/ext.php
Normal file
6
tests/functional/fixtures/ext/foobar/ext.php
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
|
||||
class phpbb_ext_fooar_ext extends phpbb_extension_base
|
||||
{
|
||||
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
<!-- INCLUDE overall_header.html -->
|
||||
|
||||
<div id="welcome">This is for testing purposes.</div>
|
||||
|
||||
<!-- INCLUDE overall_footer.html -->
|
|
@ -14,6 +14,8 @@ class phpbb_functional_test_case extends phpbb_test_case
|
|||
protected $client;
|
||||
protected $root_url;
|
||||
|
||||
protected $db = null;
|
||||
|
||||
static protected $config = array();
|
||||
static protected $already_installed = false;
|
||||
|
||||
|
@ -69,14 +71,18 @@ class phpbb_functional_test_case extends phpbb_test_case
|
|||
protected function get_db()
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
// so we don't reopen an open connection
|
||||
if (!($this->db instanceof dbal))
|
||||
{
|
||||
if (!class_exists('dbal_' . self::$config['dbms']))
|
||||
{
|
||||
include($phpbb_root_path . 'includes/db/' . self::$config['dbms'] . ".$phpEx");
|
||||
}
|
||||
$sql_db = 'dbal_' . self::$config['dbms'];
|
||||
$db = new $sql_db();
|
||||
$db->sql_connect(self::$config['dbhost'], self::$config['dbuser'], self::$config['dbpasswd'], self::$config['dbname'], self::$config['dbport']);
|
||||
return $db;
|
||||
$this->db = new $sql_db();
|
||||
$this->db->sql_connect(self::$config['dbhost'], self::$config['dbuser'], self::$config['dbpasswd'], self::$config['dbname'], self::$config['dbport']);
|
||||
}
|
||||
return $this->db;
|
||||
}
|
||||
|
||||
protected function get_ext_manager()
|
||||
|
|
Loading…
Add table
Reference in a new issue