Skip to content

Commit 12ee08e

Browse files
committed
Update tests
1 parent 983c677 commit 12ee08e

File tree

3 files changed

+30
-12
lines changed

3 files changed

+30
-12
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
/**
3+
* Modify the data for post submitting
4+
*
5+
* @event rxu.postsmerging.posts_merging_end
6+
* @since 2.0.0
7+
*/
8+
$phpbb_dispatcher->dispatch('rxu.PostsMerging.posts_merging_end');
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
/**
3+
* Modify the data for post submitting
4+
*
5+
* @event rxu.postsmerging.posts_merging_end
6+
* @since 2.0.0
7+
*/
8+
$phpbb_dispatcher->dispatch('rxu.postsmerging.posts_merging_end');

tests/php_exporter_test.php

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,29 +34,31 @@ public function extension_data()
3434
];
3535

3636
return [
37-
[27, './tests/events/invalid_name_long_multi.php', 'rxu.PostsMerging.posts_merging_end', $expected_vars, $expected_errors],
38-
[17, './tests/events/invalid_name_long_single.php', 'rxu.PostsMerging.posts_merging_end', $expected_vars, $expected_errors],
39-
[27, './tests/events/invalid_name_short_multi.php', 'rxu.PostsMerging.posts_merging_end', $expected_vars, $expected_errors],
40-
[17, './tests/events/invalid_name_short_single.php', 'rxu.PostsMerging.posts_merging_end', $expected_vars, $expected_errors],
41-
[7, './tests/events/invalid_name_simple.php', 'rxu.PostsMerging.posts_merging_end', [], $expected_errors],
42-
[27, './tests/events/valid_name_long_multi.php', 'rxu.postsmerging.posts_merging_end', $expected_vars],
43-
[17, './tests/events/valid_name_long_single.php', 'rxu.postsmerging.posts_merging_end', $expected_vars],
44-
[27, './tests/events/valid_name_short_multi.php', 'rxu.postsmerging.posts_merging_end', $expected_vars],
45-
[17, './tests/events/valid_name_short_single.php', 'rxu.postsmerging.posts_merging_end', $expected_vars],
46-
[7, './tests/events/valid_name_simple.php', 'rxu.postsmerging.posts_merging_end', []],
37+
[27, './tests/events/invalid_name_long_multi.php', false, 'rxu.PostsMerging.posts_merging_end', $expected_vars, $expected_errors],
38+
[17, './tests/events/invalid_name_long_single.php', false, 'rxu.PostsMerging.posts_merging_end', $expected_vars, $expected_errors],
39+
[27, './tests/events/invalid_name_short_multi.php', false, 'rxu.PostsMerging.posts_merging_end', $expected_vars, $expected_errors],
40+
[17, './tests/events/invalid_name_short_single.php', false, 'rxu.PostsMerging.posts_merging_end', $expected_vars, $expected_errors],
41+
[7, './tests/events/invalid_name_simple.php', false, 'rxu.PostsMerging.posts_merging_end', [], $expected_errors],
42+
[7, './tests/events/invalid_name_simple_dispatch.php', true, 'rxu.PostsMerging.posts_merging_end', [], $expected_errors],
43+
[27, './tests/events/valid_name_long_multi.php', false, 'rxu.postsmerging.posts_merging_end', $expected_vars],
44+
[17, './tests/events/valid_name_long_single.php', false, 'rxu.postsmerging.posts_merging_end', $expected_vars],
45+
[27, './tests/events/valid_name_short_multi.php', false, 'rxu.postsmerging.posts_merging_end', $expected_vars],
46+
[17, './tests/events/valid_name_short_single.php', false, 'rxu.postsmerging.posts_merging_end', $expected_vars],
47+
[7, './tests/events/valid_name_simple.php', false, 'rxu.postsmerging.posts_merging_end', []],
48+
[7, './tests/events/valid_name_simple_dispatch.php', true, 'rxu.postsmerging.posts_merging_end', []],
4749
];
4850
}
4951

5052
/**
5153
* @dataProvider extension_data
5254
*/
53-
public function test_event_name($line, $content, $expected_name, $expected_vars, $expected_errors = [])
55+
public function test_event_name($line, $content, $is_dispatch, $expected_name, $expected_vars, $expected_errors = [])
5456
{
5557
$output = new Output();
5658
$exporter = new php_exporter($output, '');
5759
$exporter->set_content(explode("\n", file_get_contents($content)));
5860

59-
$name = $exporter->get_event_name($line, false);
61+
$name = $exporter->get_event_name($line, $is_dispatch);
6062
$exporter->set_current_event($name, $line);
6163
$vars = $expected_vars ? $exporter->get_vars_from_array(false) : [];
6264

0 commit comments

Comments
 (0)