1
1
<?php
2
2
/**
3
- * Copyright (c) 2014-2016 Ryan Parman
3
+ * Copyright (c) 2014-2017 Ryan Parman
4
4
*/
5
5
6
6
namespace Skyzyx \ResultPrinter ;
7
7
8
- class ResultPrinter extends \PHPUnit_TextUI_ResultPrinter
8
+ use PHPUnit \Extensions \PhptTestCase ;
9
+ use PHPUnit \Framework \Test ;
10
+ use PHPUnit \Framework \TestCase ;
11
+ use PHPUnit \Framework \TestSuite ;
12
+ use PHPUnit \TextUI \ResultPrinter as PPrinter ;
13
+ use PHPUnit \Util \Test as TestUtil ;
14
+
15
+ class ResultPrinter extends PPrinter
9
16
{
10
17
/** @var string */
11
18
protected $ test_name_status = '' ;
@@ -71,7 +78,7 @@ protected function writeProgress($progress)
71
78
/**
72
79
* {@inheritdoc}
73
80
*/
74
- public function startTestSuite (\ PHPUnit_Framework_TestSuite $ suite )
81
+ public function startTestSuite (TestSuite $ suite )
75
82
{
76
83
if ($ this ->numTests == -1 ) {
77
84
$ this ->numTests = count ($ suite );
@@ -83,9 +90,9 @@ public function startTestSuite(\PHPUnit_Framework_TestSuite $suite)
83
90
/**
84
91
* {@inheritdoc}
85
92
*/
86
- public function endTest (\ PHPUnit_Framework_Test $ test , $ time )
93
+ public function endTest (Test $ test , $ time )
87
94
{
88
- $ test_name = \PHPUnit_Util_Test ::describe ($ test );
95
+ $ test_name = TestUtil ::describe ($ test );
89
96
90
97
if (!empty ($ test_name )) {
91
98
$ this ->test_name_status = sprintf ("%s (%s) \n" ,
@@ -98,15 +105,15 @@ public function endTest(\PHPUnit_Framework_Test $test, $time)
98
105
$ this ->writeProgress ('. ' );
99
106
}
100
107
101
- if ($ test instanceof \PHPUnit_Framework_TestCase ) {
108
+ if ($ test instanceof TestCase ) {
102
109
$ this ->numAssertions += $ test ->getNumAssertions ();
103
- } elseif ($ test instanceof \PHPUnit_Extensions_PhptTestCase ) {
110
+ } elseif ($ test instanceof PhptTestCase ) {
104
111
$ this ->numAssertions ++;
105
112
}
106
113
107
114
$ this ->lastTestFailed = false ;
108
115
109
- if ($ test instanceof \PHPUnit_Framework_TestCase ) {
116
+ if ($ test instanceof TestCase ) {
110
117
if (method_exists ($ this , 'hasExpectationOnOutput ' ) && !$ test ->hasExpectationOnOutput ()) {
111
118
$ this ->write ($ test ->getActualOutput ());
112
119
}
0 commit comments