diff options
| author | Marc Alexander <admin@m-a-styles.de> | 2015-05-28 14:16:08 +0200 |
|---|---|---|
| committer | Marc Alexander <admin@m-a-styles.de> | 2015-05-28 14:16:08 +0200 |
| commit | ef39f3a9ab1985d78ffa368b210af9ab638cbae8 (patch) | |
| tree | 77892ba541b9362223b8e84b80107e61088768a6 /tests | |
| parent | f1e11414e8e910b450ec5a0f7d2d488bc27d9f52 (diff) | |
| parent | b00b5043437e6a0e646606e914d7b6df276d8980 (diff) | |
| download | forums-ef39f3a9ab1985d78ffa368b210af9ab638cbae8.tar forums-ef39f3a9ab1985d78ffa368b210af9ab638cbae8.tar.gz forums-ef39f3a9ab1985d78ffa368b210af9ab638cbae8.tar.bz2 forums-ef39f3a9ab1985d78ffa368b210af9ab638cbae8.tar.xz forums-ef39f3a9ab1985d78ffa368b210af9ab638cbae8.zip | |
Merge pull request #3633 from nickvergessen/ticket/13872
[ticket/13872] Allow template events to have a changed version
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/event/fixtures/adm/style/acp_bbcodes.html | 0 | ||||
| -rw-r--r-- | tests/event/fixtures/normal_events.md.test | 20 | ||||
| -rw-r--r-- | tests/event/md_exporter_test.php | 97 |
3 files changed, 113 insertions, 4 deletions
diff --git a/tests/event/fixtures/adm/style/acp_bbcodes.html b/tests/event/fixtures/adm/style/acp_bbcodes.html new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/event/fixtures/adm/style/acp_bbcodes.html diff --git a/tests/event/fixtures/normal_events.md.test b/tests/event/fixtures/normal_events.md.test new file mode 100644 index 0000000000..47921c4e57 --- /dev/null +++ b/tests/event/fixtures/normal_events.md.test @@ -0,0 +1,20 @@ +acp_bbcodes_actions_append +=== +* Location: adm/style/acp_bbcodes.html +* Since: 3.1.0-a3 +* Changed: 3.1.0-a4 +* Purpose: desc1 + +acp_bbcodes_actions_prepend +=== +* Location: adm/style/acp_bbcodes.html +* Since: 3.1.0-a5 +* Purpose: desc2 + +acp_bbcodes_actions_prepend2 +=== +* Location: adm/style/acp_bbcodes.html +* Since: 3.1.0-a4 +* Changed: 3.1.0-a5 Moved up +* Changed: 3.1.0-a6 Moved down +* Purpose: desc2 diff --git a/tests/event/md_exporter_test.php b/tests/event/md_exporter_test.php index 0f9d855caa..1a51204cbe 100644 --- a/tests/event/md_exporter_test.php +++ b/tests/event/md_exporter_test.php @@ -11,21 +11,110 @@ * */ +require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; + class phpbb_event_md_exporter_test extends phpbb_test_case { - static public function crawl_eventsmd_data() { return array( + array('normal_events.md.test', null, null, array( + 'acp_bbcodes_actions_append' => array( + 'event' => 'acp_bbcodes_actions_append', + 'files' => array( + 'prosilver' => array(), + 'subsilver2' => array(), + 'adm' => array('acp_bbcodes.html'), + ), + 'since' => '3.1.0-a3', + 'changed' => array( + '3.1.0-a4' => '', + ), + 'description' => 'desc1' . "\n", + ), + 'acp_bbcodes_actions_prepend' => array( + 'event' => 'acp_bbcodes_actions_prepend', + 'files' => array( + 'prosilver' => array(), + 'subsilver2' => array(), + 'adm' => array('acp_bbcodes.html'), + ), + 'since' => '3.1.0-a5', + 'changed' => array(), + 'description' => 'desc2' . "\n", + ), + 'acp_bbcodes_actions_prepend2' => array( + 'event' => 'acp_bbcodes_actions_prepend2', + 'files' => array( + 'prosilver' => array(), + 'subsilver2' => array(), + 'adm' => array('acp_bbcodes.html'), + ), + 'since' => '3.1.0-a4', + 'changed' => array( + '3.1.0-a5' => 'Moved up', + '3.1.0-a6' => 'Moved down', + ), + 'description' => 'desc2' . "\n", + ), + )), + array('normal_events.md.test', '3.1.0-a5', '3.1.0-a5', array( + 'acp_bbcodes_actions_prepend' => array( + 'event' => 'acp_bbcodes_actions_prepend', + 'files' => array( + 'prosilver' => array(), + 'subsilver2' => array(), + 'adm' => array('acp_bbcodes.html'), + ), + 'since' => '3.1.0-a5', + 'changed' => array(), + 'description' => 'desc2' . "\n", + ), + 'acp_bbcodes_actions_prepend2' => array( + 'event' => 'acp_bbcodes_actions_prepend2', + 'files' => array( + 'prosilver' => array(), + 'subsilver2' => array(), + 'adm' => array('acp_bbcodes.html'), + ), + 'since' => '3.1.0-a4', + 'changed' => array( + '3.1.0-a5' => 'Moved up', + '3.1.0-a6' => 'Moved down', + ), + 'description' => 'desc2' . "\n", + ), + )), + ); + } + + /** + * @dataProvider crawl_eventsmd_data + * + * @param string $file + * @param string $min_version + * @param string $max_version + * @param array $events + */ + public function test_crawl_eventsmd($file, $min_version, $max_version, $events) + { + $exporter = new \phpbb\event\md_exporter(dirname(__FILE__) . '/fixtures/', null, $min_version, $max_version); + $this->assertSame(sizeof($events), $exporter->crawl_eventsmd($file, 'adm')); + $this->assertEquals($events, $exporter->get_events()); + } + + static public function crawl_phpbb_eventsmd_data() + { + return array( array('styles'), array('adm'), ); } /** - * @dataProvider crawl_eventsmd_data - */ - public function test_crawl_eventsmd($filter) + * @dataProvider crawl_phpbb_eventsmd_data + */ + public function test_crawl_phpbb_eventsmd($filter) { global $phpbb_root_path; $exporter = new \phpbb\event\md_exporter($phpbb_root_path); |
