Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 16 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| phpbb_functional_forum_style_test | |
0.00% |
0 / 16 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| test_default_forum_style | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
| test_custom_forum_style | |
0.00% |
0 / 10 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * |
| 4 | * This file is part of the phpBB Forum Software package. |
| 5 | * |
| 6 | * @copyright (c) phpBB Limited <https://www.phpbb.com> |
| 7 | * @license GNU General Public License, version 2 (GPL-2.0) |
| 8 | * |
| 9 | * For full copyright and license information, please see |
| 10 | * the docs/CREDITS.txt file. |
| 11 | * |
| 12 | */ |
| 13 | |
| 14 | /** |
| 15 | * @group functional |
| 16 | */ |
| 17 | class phpbb_functional_forum_style_test extends phpbb_functional_test_case |
| 18 | { |
| 19 | public function test_default_forum_style() |
| 20 | { |
| 21 | $crawler = self::request('GET', 'viewtopic.php?t=1&f=2'); |
| 22 | $this->assertStringContainsString('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href')); |
| 23 | |
| 24 | $crawler = self::request('GET', 'viewtopic.php?t=1'); |
| 25 | $this->assertStringContainsString('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href')); |
| 26 | |
| 27 | $crawler = self::request('GET', 'viewtopic.php?t=1&view=next'); |
| 28 | $this->assertStringContainsString('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href')); |
| 29 | } |
| 30 | |
| 31 | public function test_custom_forum_style() |
| 32 | { |
| 33 | $this->add_style(2, 'test_style'); |
| 34 | $this->db->sql_query('UPDATE ' . FORUMS_TABLE . ' SET forum_style = 2 WHERE forum_id = 2'); |
| 35 | |
| 36 | $crawler = self::request('GET', 'viewtopic.php?t=1&f=2'); |
| 37 | $this->assertStringContainsString('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href')); |
| 38 | |
| 39 | $crawler = self::request('GET', 'viewtopic.php?t=1'); |
| 40 | $this->assertStringContainsString('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href')); |
| 41 | |
| 42 | $crawler = self::request('GET', 'viewtopic.php?t=1&view=next'); |
| 43 | $this->assertStringContainsString('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href')); |
| 44 | |
| 45 | $this->db->sql_query('UPDATE ' . FORUMS_TABLE . ' SET forum_style = 0 WHERE forum_id = 2'); |
| 46 | $this->delete_style(2, 'test_style'); |
| 47 | } |
| 48 | } |