aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2012-03-31 17:22:54 +0200
committerIgor Wiedler <igor@wiedler.ch>2012-03-31 17:22:54 +0200
commit0ae491c5fa9228304e17431ea7aa8ba9303cc193 (patch)
tree9d3fcccb13d8bda12ae7f0dec3321c7375d8e621 /tests
parente7a4437c1bccace4a0637241a8f386e686d9c3fb (diff)
parent5d07b16ec647f51d51504cf9d6a0861a975ceb8e (diff)
downloadforums-0ae491c5fa9228304e17431ea7aa8ba9303cc193.tar
forums-0ae491c5fa9228304e17431ea7aa8ba9303cc193.tar.gz
forums-0ae491c5fa9228304e17431ea7aa8ba9303cc193.tar.bz2
forums-0ae491c5fa9228304e17431ea7aa8ba9303cc193.tar.xz
forums-0ae491c5fa9228304e17431ea7aa8ba9303cc193.zip
Merge remote-tracking branch 'cyberalien/feature/merging-style-components' into develop
* cyberalien/feature/merging-style-components: (31 commits) [feature/merging-style-components] Fix back link on install page [feature/merging-style-components] Fix for unit tests [feature/merging-style-components] Moving template initialization out of style [feature/merging-style-components] Renaming "delete" to "uninstall" for styles [feature/merging-style-components] Initializing locator and provider separately [feature/merging-style-components] Fixing few errors in acp_styles [feature/merging-style-components] Fix notices in acp_styles [feature/merging-style-components] Updating styles in coding guidelines [feature/merging-style-components] Changing acp_styles text [feature/merging-style-components] Updating test cases [feature/merging-style-components] Updating style initialization [feature/merging-style-components] Changing style class [feature/merging-style-components] Changing template class [feature/merging-style-components] Changing resource locator [feature/merging-style-components] Changing path provider [feature/merging-style-components] Renaming style locator [feature/merging-style-components] Changing $style to $style_id [feature/merging-style-components] Creating style class [feature/merging-style-components] New acp_styles template [feature/merging-style-components] New acp_styles ...
Diffstat (limited to 'tests')
-rw-r--r--tests/dbal/fixtures/styles.xml24
-rw-r--r--tests/dbal/order_lower_test.php18
-rw-r--r--tests/template/includephp_test.php2
-rw-r--r--tests/template/renderer_eval_test.php4
-rw-r--r--tests/template/template_compile_test.php2
-rw-r--r--tests/template/template_inheritance_test.php9
-rw-r--r--tests/template/template_test.php4
-rw-r--r--tests/template/template_test_case.php14
8 files changed, 47 insertions, 30 deletions
diff --git a/tests/dbal/fixtures/styles.xml b/tests/dbal/fixtures/styles.xml
index 36fc22a48f..dcbe39d3b0 100644
--- a/tests/dbal/fixtures/styles.xml
+++ b/tests/dbal/fixtures/styles.xml
@@ -5,31 +5,39 @@
<column>style_name</column>
<column>style_copyright</column>
<column>style_active</column>
- <column>template_id</column>
- <column>theme_id</column>
+ <column>style_path</column>
+ <column>bbcode_bitfield</column>
+ <column>style_parent_id</column>
+ <column>style_parent_tree</column>
<row>
<value>1</value>
<value>prosilver</value>
<value>&amp;copy; phpBB Group</value>
<value>1</value>
- <value>1</value>
- <value>1</value>
+ <value>prosilver</value>
+ <value>kNg=</value>
+ <value>0</value>
+ <value></value>
</row>
<row>
<value>2</value>
<value>prosilver2</value>
<value>&amp;copy; phpBB Group</value>
<value>0</value>
- <value>2</value>
- <value>2</value>
+ <value>prosilver2</value>
+ <value>kNg=</value>
+ <value>0</value>
+ <value></value>
</row>
<row>
<value>3</value>
<value>Prosilver1</value>
<value>&amp;copy; phpBB Group</value>
<value>0</value>
- <value>3</value>
- <value>3</value>
+ <value>prosilver1</value>
+ <value>kNg=</value>
+ <value>1</value>
+ <value>prosilver</value>
</row>
</table>
</dataset>
diff --git a/tests/dbal/order_lower_test.php b/tests/dbal/order_lower_test.php
index eaf5211508..e16c0c20ee 100644
--- a/tests/dbal/order_lower_test.php
+++ b/tests/dbal/order_lower_test.php
@@ -33,24 +33,30 @@ class phpbb_dbal_order_lower_test extends phpbb_database_test_case
'style_name' => 'prosilver',
'style_copyright' => '&copy; phpBB Group',
'style_active' => 1,
- 'template_id' => 1,
- 'theme_id' => 1,
+ 'style_path' => 'prosilver',
+ 'bbcode_bitfield' => 'kNg=',
+ 'style_parent_id' => 0,
+ 'style_parent_tree' => '',
),
array(
'style_id' => 3,
'style_name' => 'Prosilver1',
'style_copyright' => '&copy; phpBB Group',
'style_active' => 0,
- 'template_id' => 3,
- 'theme_id' => 3,
+ 'style_path' => 'prosilver1',
+ 'bbcode_bitfield' => 'kNg=',
+ 'style_parent_id' => 1,
+ 'style_parent_tree' => 'prosilver',
),
array(
'style_id' => 2,
'style_name' => 'prosilver2',
'style_copyright' => '&copy; phpBB Group',
'style_active' => 0,
- 'template_id' => 2,
- 'theme_id' => 2,
+ 'style_path' => 'prosilver2',
+ 'bbcode_bitfield' => 'kNg=',
+ 'style_parent_id' => 0,
+ 'style_parent_tree' => '',
)
),
$db->sql_fetchrowset($result)
diff --git a/tests/template/includephp_test.php b/tests/template/includephp_test.php
index 28ea118a13..626735f15f 100644
--- a/tests/template/includephp_test.php
+++ b/tests/template/includephp_test.php
@@ -36,7 +36,7 @@ class phpbb_template_includephp_test extends phpbb_template_template_test_case
$this->setup_engine(array('tpl_allow_php' => true));
- $this->template->set_custom_template($cache_dir, 'tests');
+ $this->style->set_custom_style('tests', $cache_dir);
$cache_file = $this->template->cachepath . 'includephp_absolute.html.php';
$this->run_template('includephp_absolute.html', array(), array(), array(), "Path is absolute.\ntesting included php", $cache_file);
diff --git a/tests/template/renderer_eval_test.php b/tests/template/renderer_eval_test.php
index 7ebb8b9bda..9b4f74c824 100644
--- a/tests/template/renderer_eval_test.php
+++ b/tests/template/renderer_eval_test.php
@@ -13,8 +13,8 @@ class phpbb_template_renderer_eval_test extends phpbb_test_case
{
$compiled_code = '<a href="<?php echo \'Test\'; ?>">';
$valid_code = '<a href="Test">';
- $context = new phpbb_template_context();
- $template = new phpbb_template_renderer_eval($compiled_code, NULL);
+ $context = new phpbb_style_template_context();
+ $template = new phpbb_style_template_renderer_eval($compiled_code, NULL);
ob_start();
try
{
diff --git a/tests/template/template_compile_test.php b/tests/template/template_compile_test.php
index a5e8a5e87a..fb158cabd5 100644
--- a/tests/template/template_compile_test.php
+++ b/tests/template/template_compile_test.php
@@ -16,7 +16,7 @@ class phpbb_template_template_compile_test extends phpbb_test_case
protected function setUp()
{
- $this->template_compile = new phpbb_template_compile(false);
+ $this->template_compile = new phpbb_style_template_compile(false);
$this->template_path = dirname(__FILE__) . '/templates';
}
diff --git a/tests/template/template_inheritance_test.php b/tests/template/template_inheritance_test.php
index 6987ae6c73..7348da9a4a 100644
--- a/tests/template/template_inheritance_test.php
+++ b/tests/template/template_inheritance_test.php
@@ -71,9 +71,10 @@ class phpbb_template_template_inheritance_test extends phpbb_template_template_t
$this->template_path = dirname(__FILE__) . '/templates';
$this->parent_template_path = dirname(__FILE__) . '/parent_templates';
- $this->template_locator = new phpbb_template_locator();
- $this->template_provider = new phpbb_template_path_provider();
- $this->template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $this->template_locator, $this->template_provider);
- $this->template->set_custom_template($this->template_path, 'tests', $this->parent_template_path, 'parent');
+ $this->style_resource_locator = new phpbb_style_resource_locator();
+ $this->style_provider = new phpbb_style_path_provider();
+ $this->template = new phpbb_style_template($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator, $this->style_provider);
+ $this->style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator, $this->style_provider, $this->template);
+ $this->style->set_custom_style('tests', array($this->template_path, $this->parent_template_path), '');
}
}
diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index 76b1af68d8..edf621e16c 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -277,7 +277,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
$this->template->set_filenames(array('test' => $filename));
$this->assertFileNotExists($this->template_path . '/' . $filename, 'Testing missing file, file cannot exist');
- $expecting = sprintf('template locator: File for handle test does not exist. Could not find: %s', realpath($this->template_path . '/../') . '/templates/' . $filename);
+ $expecting = sprintf('style resource locator: File for handle test does not exist. Could not find: %s', realpath($this->template_path . '/../') . '/templates/' . $filename);
$this->setExpectedTriggerError(E_USER_ERROR, $expecting);
$this->display('test');
@@ -285,7 +285,7 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
public function test_empty_file()
{
- $expecting = 'template locator: set_filenames: Empty filename specified for test';
+ $expecting = 'style resource locator: set_filenames: Empty filename specified for test';
$this->setExpectedTriggerError(E_USER_ERROR, $expecting);
$this->template->set_filenames(array('test' => ''));
diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php
index 5b60785fee..a87e531a07 100644
--- a/tests/template/template_test_case.php
+++ b/tests/template/template_test_case.php
@@ -12,10 +12,11 @@ require_once dirname(__FILE__) . '/../mock/extension_manager.php';
class phpbb_template_template_test_case extends phpbb_test_case
{
+ protected $style;
protected $template;
protected $template_path;
- protected $template_locator;
- protected $template_provider;
+ protected $style_resource_locator;
+ protected $style_provider;
// Keep the contents of the cache for debugging?
const PRESERVE_CACHE = true;
@@ -63,10 +64,11 @@ class phpbb_template_template_test_case extends phpbb_test_case
$config = new phpbb_config(array_merge($defaults, $new_config));
$this->template_path = dirname(__FILE__) . '/templates';
- $this->template_locator = new phpbb_template_locator();
- $this->template_provider = new phpbb_template_path_provider();
- $this->template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $this->template_locator, $this->template_provider);
- $this->template->set_custom_template($this->template_path, 'tests');
+ $this->style_resource_locator = new phpbb_style_resource_locator();
+ $this->style_provider = new phpbb_style_path_provider();
+ $this->template = new phpbb_style_template($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator, $this->style_provider);
+ $this->style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator, $this->style_provider, $this->template);
+ $this->style->set_custom_style('tests', $this->template_path, '');
}
protected function setUp()