Conditions | 5 |
Paths | 8 |
Total Lines | 31 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | public function providerSample() |
||
27 | { |
||
28 | $skipped = [ |
||
29 | 'Chart/32_Chart_read_write_PDF.php', // Unfortunately JpGraph is not up to date for latest PHP and raise many warnings |
||
30 | 'Chart/32_Chart_read_write_HTML.php', // idem |
||
31 | ]; |
||
32 | |||
33 | // Unfortunately some tests are too long be ran with code-coverage |
||
34 | // analysis on Travis, so we need to exclude them |
||
35 | global $argv; |
||
|
|||
36 | if (in_array('--coverage-clover', $argv)) { |
||
37 | $tooLongToBeCovered = [ |
||
38 | 'Basic/06_Largescale.php', |
||
39 | 'Basic/13_CalculationCyclicFormulae.php', |
||
40 | ]; |
||
41 | $skipped = array_merge($skipped, $tooLongToBeCovered); |
||
42 | } |
||
43 | |||
44 | $helper = new Sample(); |
||
45 | $result = []; |
||
46 | foreach ($helper->getSamples() as $samples) { |
||
47 | foreach ($samples as $sample) { |
||
48 | if (!in_array($sample, $skipped)) { |
||
49 | $file = '../samples/' . $sample; |
||
50 | $result[] = [$file]; |
||
51 | } |
||
52 | } |
||
53 | } |
||
54 | |||
55 | return $result; |
||
56 | } |
||
57 | } |
||
58 |
Instead of relying on
global
state, we recommend one of these alternatives:1. Pass all data via parameters
2. Create a class that maintains your state