[ticket/10586] Adding the extensions used by the tests

PHPBB3-10586
This commit is contained in:
David King 2012-02-21 11:17:21 -05:00
parent a37a28b485
commit d235262bc2
13 changed files with 137 additions and 6 deletions

View 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();
}
}

View file

@ -0,0 +1,6 @@
<?php
class phpbb_ext_error_class_ext extends phpbb_extension_base
{
}

View 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();
}
}

View file

@ -0,0 +1,6 @@
<?php
class phpbb_ext_error_classtype_ext extends phpbb_extension_base
{
}

View 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();
}
}

View file

@ -0,0 +1,6 @@
<?php
class phpbb_ext_error_disabled_ext extends phpbb_extension_base
{
}

View 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();
}
}

View file

@ -0,0 +1,6 @@
<?php
class phpbb_ext_foo_bar_ext extends phpbb_extension_base
{
}

View file

@ -0,0 +1,5 @@
<!-- INCLUDE overall_header.html -->
<div id="welcome">This is for testing purposes.</div>
<!-- INCLUDE overall_footer.html -->

View 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();
}
}

View file

@ -0,0 +1,6 @@
<?php
class phpbb_ext_fooar_ext extends phpbb_extension_base
{
}

View file

@ -0,0 +1,5 @@
<!-- INCLUDE overall_header.html -->
<div id="welcome">This is for testing purposes.</div>
<!-- INCLUDE overall_footer.html -->

View file

@ -14,6 +14,8 @@ class phpbb_functional_test_case extends phpbb_test_case
protected $client; protected $client;
protected $root_url; protected $root_url;
protected $db = null;
static protected $config = array(); static protected $config = array();
static protected $already_installed = false; static protected $already_installed = false;
@ -69,14 +71,18 @@ class phpbb_functional_test_case extends phpbb_test_case
protected function get_db() protected function get_db()
{ {
global $phpbb_root_path, $phpEx; global $phpbb_root_path, $phpEx;
if (!class_exists('dbal_' . self::$config['dbms'])) // so we don't reopen an open connection
if (!($this->db instanceof dbal))
{ {
include($phpbb_root_path . 'includes/db/' . self::$config['dbms'] . ".$phpEx"); if (!class_exists('dbal_' . self::$config['dbms']))
{
include($phpbb_root_path . 'includes/db/' . self::$config['dbms'] . ".$phpEx");
}
$sql_db = 'dbal_' . self::$config['dbms'];
$this->db = new $sql_db();
$this->db->sql_connect(self::$config['dbhost'], self::$config['dbuser'], self::$config['dbpasswd'], self::$config['dbname'], self::$config['dbport']);
} }
$sql_db = 'dbal_' . self::$config['dbms']; return $this->db;
$db = new $sql_db();
$db->sql_connect(self::$config['dbhost'], self::$config['dbuser'], self::$config['dbpasswd'], self::$config['dbname'], self::$config['dbport']);
return $db;
} }
protected function get_ext_manager() protected function get_ext_manager()