Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
36.36% covered (danger)
36.36%
4 / 11
66.67% covered (warning)
66.67%
2 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
phpbb_event_export_php_test
36.36% covered (danger)
36.36%
4 / 11
66.67% covered (warning)
66.67%
2 / 3
8.12
0.00% covered (danger)
0.00%
0 / 1
 setUp
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
 crawl_php_file_data
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 1
6
 test_crawl_php_file
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2/**
3*
4* This file is part of the phpBB Forum Software package.
5*
6* @copyright (c) phpBB Limited <https://www.phpbb.com>
7* @license GNU General Public License, version 2 (GPL-2.0)
8*
9* For full copyright and license information, please see
10* the docs/CREDITS.txt file.
11*
12*/
13
14class phpbb_event_export_php_test extends phpbb_test_case
15{
16    /** @var \phpbb\event\php_exporter */
17    protected $exporter;
18
19    protected function setUp(): void
20    {
21        parent::setUp();
22
23        global $phpbb_root_path;
24        $this->exporter = new \phpbb\event\php_exporter($phpbb_root_path);
25    }
26
27    static public function crawl_php_file_data()
28    {
29        global $phpbb_root_path;
30        $exporter = new \phpbb\event\php_exporter($phpbb_root_path);
31        $files = $exporter->get_recursive_file_list();
32
33        $data_provider = array();
34        foreach ($files as $file)
35        {
36            $data_provider[] = array($file);
37        }
38
39        return $data_provider;
40    }
41
42    /**
43    * @dataProvider crawl_php_file_data
44    */
45    public function test_crawl_php_file($file)
46    {
47        $this->assertGreaterThanOrEqual(0, $this->exporter->crawl_php_file($file));
48    }
49}