Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
Stats
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 3
12
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 allFailures
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
 accum
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2declare( strict_types = 1 );
3
4namespace Wikimedia\Parsoid\ParserTests;
5
6class Stats {
7    /** @var float */
8    public $startTime;
9
10    /** @var Stats[] */
11    public $modes;
12
13    /** @var int */
14    public $passedTests = 0;
15
16    /** @var int */
17    public $passedTestsUnexpected = 0;
18
19    /** @var int */
20    public $failedTests = 0;
21
22    /** @var int */
23    public $failedTestsUnexpected = 0;
24
25    /** @var int */
26    public $loggedErrorCount = 0;
27
28    /** @var int */
29    public $failures = 0;
30
31    /** @var array Array of elements representing test failures */
32    public $failList;
33
34    /** @var string result */
35    public $result;
36
37    public function __construct() {
38        $this->startTime = microtime( true );
39    }
40
41    public function allFailures(): int {
42        $this->failures = $this->passedTestsUnexpected +
43            $this->failedTestsUnexpected + $this->loggedErrorCount;
44
45        return $this->failures;
46    }
47
48    public function accum( Stats $other ): void {
49        $this->passedTests += $other->passedTests;
50        $this->passedTestsUnexpected += $other->passedTestsUnexpected;
51        $this->failedTests += $other->failedTests;
52        $this->failedTestsUnexpected += $other->failedTestsUnexpected;
53        $this->loggedErrorCount += $other->loggedErrorCount;
54        $this->failures += $other->failures;
55    }
56}