aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-04-20 17:01:00 +0200
committerJoas Schilling <nickvergessen@gmx.de>2014-04-24 16:51:40 +0200
commit58892555299ad9df5bdd2c5401a854068860e68d (patch)
treee44f7e28c85ef7daec39d8b0fd46dda6fe13f53f /tests
parent7dc32a45e5c43f29b19b8a8138b515c9e09d23de (diff)
downloadforums-58892555299ad9df5bdd2c5401a854068860e68d.tar
forums-58892555299ad9df5bdd2c5401a854068860e68d.tar.gz
forums-58892555299ad9df5bdd2c5401a854068860e68d.tar.bz2
forums-58892555299ad9df5bdd2c5401a854068860e68d.tar.xz
forums-58892555299ad9df5bdd2c5401a854068860e68d.zip
[ticket/12273] Test source files and compare with events.md
PHPBB3-12273
Diffstat (limited to 'tests')
-rw-r--r--tests/event/md_exporter_test.php37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/event/md_exporter_test.php b/tests/event/md_exporter_test.php
index 52d10bd3e3..5fb3a99254 100644
--- a/tests/event/md_exporter_test.php
+++ b/tests/event/md_exporter_test.php
@@ -27,4 +27,41 @@ class phpbb_event_md_exporter_test extends phpbb_test_case
$exporter = new \phpbb\event\md_exporter($phpbb_root_path);
$this->assertGreaterThan(0, $exporter->crawl_eventsmd('docs/events.md', $filter));
}
+
+ static public function crawl_adm_files_data()
+ {
+ global $phpbb_root_path;
+ $exporter = new \phpbb\event\md_exporter($phpbb_root_path);
+ $data_provider = array();
+
+ $styles = array(
+ 'adm/style/' => 'adm',
+ 'styles/prosilver/template/' => 'styles',
+ 'styles/subsilver2/template/' => 'styles',
+ );
+ foreach ($styles as $path => $filter)
+ {
+ $files = $exporter->get_recursive_file_list($phpbb_root_path . $path, $path);
+ foreach ($files as $file)
+ {
+ $data_provider[] = array($filter, $path . $file);
+ }
+ }
+
+ return $data_provider;
+ }
+
+ /**
+ * @dataProvider crawl_adm_files_data
+ */
+ public function test_crawl_adm_files($filter, $file)
+ {
+ global $phpbb_root_path;
+ $exporter = new \phpbb\event\md_exporter($phpbb_root_path);
+ $exporter->crawl_eventsmd('docs/events.md', $filter);
+ $events = $exporter->crawl_file_for_events($file);
+
+ $this->assertGreaterThanOrEqual(0, sizeof($events));
+ $this->assertTrue($exporter->validate_events_from_file($file, $events));
+ }
}