aboutsummaryrefslogtreecommitdiffstats
path: root/tests/event
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-04-18 11:06:04 +0200
committerJoas Schilling <nickvergessen@gmx.de>2014-04-18 12:57:06 +0200
commitd213e09a40cb0ee9c94c35b3aecb1814d740184a (patch)
treea994e46f6c849f705c24a5b8b93a57244b190efc /tests/event
parentb831e96aafc4b8c2bc883dd47c4f2452f329e5b2 (diff)
downloadforums-d213e09a40cb0ee9c94c35b3aecb1814d740184a.tar
forums-d213e09a40cb0ee9c94c35b3aecb1814d740184a.tar.gz
forums-d213e09a40cb0ee9c94c35b3aecb1814d740184a.tar.bz2
forums-d213e09a40cb0ee9c94c35b3aecb1814d740184a.tar.xz
forums-d213e09a40cb0ee9c94c35b3aecb1814d740184a.zip
[ticket/12273] Crawl the phpBB directory for events
PHPBB3-12273
Diffstat (limited to 'tests/event')
-rw-r--r--tests/event/exporter_test.php27
1 files changed, 18 insertions, 9 deletions
diff --git a/tests/event/exporter_test.php b/tests/event/exporter_test.php
index df5a258bbb..5736476f45 100644
--- a/tests/event/exporter_test.php
+++ b/tests/event/exporter_test.php
@@ -20,7 +20,7 @@ class phpbb_event_exporter_test extends phpbb_test_case
$this->exporter = new \event_exporter(dirname(__FILE__) . '/fixtures/');
}
- static public function check_for_events_data()
+ static public function crawl_php_file_data()
{
return array(
array(
@@ -67,15 +67,17 @@ class phpbb_event_exporter_test extends phpbb_test_case
}
/**
- * @dataProvider check_for_events_data
+ * @dataProvider crawl_php_file_data
*/
- public function test_check_for_events($file, $expected)
+ public function test_crawl_php_file($file, $expected)
{
- $this->exporter->check_for_events($file);
- $this->assertEquals($expected, $this->exporter->get_events());
+ $this->exporter->crawl_php_file($file);
+ $events = $this->exporter->get_events();
+ $this->assertArrayHasKey('php', $events);
+ $this->assertEquals($expected, $events['php']);
}
- static public function check_for_events_throws_data()
+ static public function crawl_php_file_throws_data()
{
return array(
array('missing_var.test', null),
@@ -84,12 +86,12 @@ class phpbb_event_exporter_test extends phpbb_test_case
}
/**
- * @dataProvider check_for_events_throws_data
+ * @dataProvider crawl_php_file_throws_data
*/
- public function test_check_for_events_throws($file, $exception_code)
+ public function test_crawl_php_file_throws($file, $exception_code)
{
$this->setExpectedException('LogicException', '', $exception_code);
- $this->assertNull($this->exporter->check_for_events($file));
+ $this->exporter->crawl_php_file($file);
}
static public function validate_since_data()
@@ -663,4 +665,11 @@ class phpbb_event_exporter_test extends phpbb_test_case
$this->exporter->set_content($lines);
$this->exporter->find_description();
}
+
+ public function test_crawl_phpbb_directory_php()
+ {
+ global $phpbb_root_path;
+ $exporter = new \event_exporter($phpbb_root_path);
+ $this->assertGreaterThan(0, $exporter->crawl_phpbb_directory_php());
+ }
}