1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* @author Jared King <[email protected]> |
5
|
|
|
* |
6
|
|
|
* @link http://jaredtking.com |
7
|
|
|
* |
8
|
|
|
* @copyright 2015 Jared King |
9
|
|
|
* @license MIT |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace Infuse; |
13
|
|
|
|
14
|
|
|
use Exception; |
15
|
|
|
use PHPUnit_Framework_AssertionFailedError; |
16
|
|
|
use PHPUnit_Framework_Test; |
17
|
|
|
use PHPUnit\Framework\TestListener; |
18
|
|
|
use PHPUnit_Framework_TestSuite; |
19
|
|
|
|
20
|
|
|
class Test implements TestListener |
21
|
|
|
{ |
22
|
|
|
/** |
23
|
|
|
* @var Application |
24
|
|
|
*/ |
25
|
|
|
public static $app; |
26
|
|
|
|
27
|
|
|
public function __construct() |
28
|
|
|
{ |
29
|
|
|
// display all errors, log none |
30
|
|
|
ini_set('display_errors', 1); |
31
|
|
|
ini_set('log_errors', 0); |
32
|
|
|
error_reporting(E_ALL | E_STRICT); |
33
|
|
|
|
34
|
|
|
$config = []; |
35
|
|
|
if (file_exists('config.php')) { |
36
|
|
|
$config = include 'config.php'; |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
self::$app = new Application($config, Application::ENV_TEST); |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
public function addError(PHPUnit_Framework_Test $test, Exception $e, $time) |
43
|
|
|
{ |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
public function addFailure(PHPUnit_Framework_Test $test, PHPUnit_Framework_AssertionFailedError $e, $time) |
47
|
|
|
{ |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
public function addIncompleteTest(PHPUnit_Framework_Test $test, Exception $e, $time) |
51
|
|
|
{ |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
public function addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, $time) |
55
|
|
|
{ |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) |
59
|
|
|
{ |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
public function startTest(PHPUnit_Framework_Test $test) |
63
|
|
|
{ |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
public function endTest(PHPUnit_Framework_Test $test, $time) |
67
|
|
|
{ |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
public function startTestSuite(PHPUnit_Framework_TestSuite $suite) |
71
|
|
|
{ |
72
|
|
|
printf("\n\n%s:\n", $suite->getName()); |
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
public function endTestSuite(PHPUnit_Framework_TestSuite $suite) |
76
|
|
|
{ |
77
|
|
|
} |
78
|
|
|
} |
79
|
|
|
|