diff options
author | Nathaniel Guse <nathaniel.guse@gmail.com> | 2013-07-11 13:12:41 -0500 |
---|---|---|
committer | Nathaniel Guse <nathaniel.guse@gmail.com> | 2013-07-11 13:12:41 -0500 |
commit | cb0335ebcb580eafaf1bd2bed1663b31af77ef40 (patch) | |
tree | 62cd59e6d2ef176ae27616c712b22fd2488bf3b3 /tests | |
parent | 5b81cad775bcb65fc48a17e5e80c4bde61ac502d (diff) | |
parent | c2f5ba69f0fb03a30d4f3cbf1e6d49e019edea7c (diff) | |
download | forums-cb0335ebcb580eafaf1bd2bed1663b31af77ef40.tar forums-cb0335ebcb580eafaf1bd2bed1663b31af77ef40.tar.gz forums-cb0335ebcb580eafaf1bd2bed1663b31af77ef40.tar.bz2 forums-cb0335ebcb580eafaf1bd2bed1663b31af77ef40.tar.xz forums-cb0335ebcb580eafaf1bd2bed1663b31af77ef40.zip |
Merge remote-tracking branch 'remotes/cyberalien/ticket/develop/10772' into develop
# By Vjacheslav Trushkin
# Via Vjacheslav Trushkin
* remotes/cyberalien/ticket/develop/10772:
[ticket/develop/10772] Fix copyright year
[ticket/develop/10772] Unit tests for forum specific style
[ticket/10772] Use forum specific style for trigger_error
Diffstat (limited to 'tests')
-rw-r--r-- | tests/functional/forum_style_test.php | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/tests/functional/forum_style_test.php b/tests/functional/forum_style_test.php new file mode 100644 index 0000000000..1f38c2d057 --- /dev/null +++ b/tests/functional/forum_style_test.php @@ -0,0 +1,53 @@ +<?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_forum_style_test extends phpbb_functional_test_case +{ + public function test_forum_style() + { + // Test with default style + $crawler = $this->request('GET', 'viewtopic.php?t=1&f=2'); + $this->assert_response_success(); + $this->assertContains('styles/prosilver/theme/print.css', $this->client->getResponse()->getContent()); + + $crawler = $this->request('GET', 'viewtopic.php?t=1&f=2&view=next'); + $this->assert_response_success(); + $this->assertContains('styles/prosilver/theme/print.css', $this->client->getResponse()->getContent()); + + // Insert new style and change forum style + $db = $this->get_db(); + $db->sql_multi_insert(STYLES_TABLE, array( + 'style_id' => 2, + 'style_name' => 'test_style', + 'style_copyright' => '', + 'style_active' => 1, + 'style_path' => 'test_style', + 'bbcode_bitfield' => 'kNg=', + 'style_parent_id' => 1, + 'style_parent_tree' => 'prosilver', + )); + $db->sql_query('UPDATE ' . FORUMS_TABLE . ' SET forum_style = 2 WHERE forum_id = 2'); + + // Test with custom style + $crawler = $this->request('GET', 'viewtopic.php?t=1&f=2'); + $this->assert_response_success(); + $this->assertContains('styles/test_style/theme/print.css', $this->client->getResponse()->getContent()); + + $crawler = $this->request('GET', 'viewtopic.php?t=1&f=2&view=next'); + $this->assert_response_success(); + $this->assertContains('styles/test_style/theme/print.css', $this->client->getResponse()->getContent()); + + // Undo changes + $db->sql_query('UPDATE ' . FORUMS_TABLE . ' SET forum_style = 0 WHERE forum_id = 2'); + $db->sql_query('DELETE FROM ' . STYLES_TABLE . ' WHERE style_id = 2'); + } +} |