diff options
author | rxu <rxu@mail.ru> | 2017-08-15 16:57:30 +0700 |
---|---|---|
committer | rxu <rxu@mail.ru> | 2017-08-15 17:10:42 +0700 |
commit | e67d2ae3b9d71bfd9aa82ec250c13d1186b1e280 (patch) | |
tree | 55f114b457f8a2f5bb3d26f6fc0084771aca4e6e /tests/text_formatter/s9e/factory_test.php | |
parent | aabb9d2e488e465d48d9910f98a861ab96f55f74 (diff) | |
download | forums-e67d2ae3b9d71bfd9aa82ec250c13d1186b1e280.tar forums-e67d2ae3b9d71bfd9aa82ec250c13d1186b1e280.tar.gz forums-e67d2ae3b9d71bfd9aa82ec250c13d1186b1e280.tar.bz2 forums-e67d2ae3b9d71bfd9aa82ec250c13d1186b1e280.tar.xz forums-e67d2ae3b9d71bfd9aa82ec250c13d1186b1e280.zip |
[ticket/15323] Run s9e configurator tests on twigified bbcode.html
PHPBB3-15323
Diffstat (limited to 'tests/text_formatter/s9e/factory_test.php')
-rw-r--r-- | tests/text_formatter/s9e/factory_test.php | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/tests/text_formatter/s9e/factory_test.php b/tests/text_formatter/s9e/factory_test.php index 3d3ea8b794..82b1b0043b 100644 --- a/tests/text_formatter/s9e/factory_test.php +++ b/tests/text_formatter/s9e/factory_test.php @@ -32,9 +32,15 @@ class phpbb_textformatter_s9e_factory_test extends phpbb_database_test_case return __DIR__ . '/../../tmp/'; } - public function get_factory() + public function get_factory($styles_path = null) { global $config, $phpbb_root_path, $request, $user; + + if (!isset($styles_path)) + { + $styles_path = $phpbb_root_path . 'styles/'; + } + $this->cache = new phpbb_mock_cache; $dal = new \phpbb\textformatter\data_access( $this->new_dbal(), @@ -42,7 +48,7 @@ class phpbb_textformatter_s9e_factory_test extends phpbb_database_test_case 'phpbb_smilies', 'phpbb_styles', 'phpbb_words', - $phpbb_root_path . 'styles/' + $styles_path ); $factory = new \phpbb\textformatter\s9e\factory( $dal, @@ -68,10 +74,8 @@ class phpbb_textformatter_s9e_factory_test extends phpbb_database_test_case return $factory; } - public function test_get_configurator() + public function run_configurator_assertions($configurator) { - $configurator = $this->get_factory()->get_configurator(); - $this->assertInstanceOf('s9e\\TextFormatter\\Configurator', $configurator); $this->assertTrue(isset($configurator->plugins['Autoemail'])); @@ -97,6 +101,17 @@ class phpbb_textformatter_s9e_factory_test extends phpbb_database_test_case $this->assertTrue(isset($configurator->Emoticons[':D'])); } + public function test_get_configurator() + { + $configurator = $this->get_factory()->get_configurator(); + $this->run_configurator_assertions($configurator); + + // Test with twigified bbcode.html + $configurator = $this->get_factory(__DIR__ . '/fixtures/styles/')->get_configurator(); + $this->run_configurator_assertions($configurator); + + } + public function test_regenerate() { extract($this->get_factory()->regenerate()); |