Skip to content
This repository was archived by the owner on May 26, 2021. It is now read-only.

Commit 9b1783c

Browse files
committed
Bumping up to PHPUnit 6.0.
1 parent 20a08dd commit 9b1783c

File tree

3 files changed

+18
-11
lines changed

3 files changed

+18
-11
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Configuration: /Library/WebServer/Documents/php-strong-types/phpunit.xml.dist
126126

127127
Using [Composer]:
128128
```bash
129-
composer require skyzyx/phpunit-result-printer=^1.0
129+
composer require skyzyx/phpunit-result-printer=^2.0
130130
```
131131

132132
And include it in your scripts:
@@ -160,7 +160,7 @@ Here's the process for contributing:
160160

161161
## Authors, Copyright & Licensing
162162

163-
* Copyright (c) 2014-2016 [Ryan Parman](http://ryanparman.com).
163+
* Copyright (c) 2014-2017 [Ryan Parman](http://ryanparman.com).
164164

165165
See also the list of [contributors](https://github.com/skyzyx/phpunit-result-printer/contributors) who participated in this project.
166166

ResultPrinter.php

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
<?php
22
/**
3-
* Copyright (c) 2014-2016 Ryan Parman
3+
* Copyright (c) 2014-2017 Ryan Parman
44
*/
55

66
namespace Skyzyx\ResultPrinter;
77

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
916
{
1017
/** @var string */
1118
protected $test_name_status = '';
@@ -71,7 +78,7 @@ protected function writeProgress($progress)
7178
/**
7279
* {@inheritdoc}
7380
*/
74-
public function startTestSuite(\PHPUnit_Framework_TestSuite $suite)
81+
public function startTestSuite(TestSuite $suite)
7582
{
7683
if ($this->numTests == -1) {
7784
$this->numTests = count($suite);
@@ -83,9 +90,9 @@ public function startTestSuite(\PHPUnit_Framework_TestSuite $suite)
8390
/**
8491
* {@inheritdoc}
8592
*/
86-
public function endTest(\PHPUnit_Framework_Test $test, $time)
93+
public function endTest(Test $test, $time)
8794
{
88-
$test_name = \PHPUnit_Util_Test::describe($test);
95+
$test_name = TestUtil::describe($test);
8996

9097
if (!empty($test_name)) {
9198
$this->test_name_status = sprintf("%s (%s)\n",
@@ -98,15 +105,15 @@ public function endTest(\PHPUnit_Framework_Test $test, $time)
98105
$this->writeProgress('.');
99106
}
100107

101-
if ($test instanceof \PHPUnit_Framework_TestCase) {
108+
if ($test instanceof TestCase) {
102109
$this->numAssertions += $test->getNumAssertions();
103-
} elseif ($test instanceof \PHPUnit_Extensions_PhptTestCase) {
110+
} elseif ($test instanceof PhptTestCase) {
104111
$this->numAssertions++;
105112
}
106113

107114
$this->lastTestFailed = false;
108115

109-
if ($test instanceof \PHPUnit_Framework_TestCase) {
116+
if ($test instanceof TestCase) {
110117
if (method_exists($this, 'hasExpectationOnOutput') && !$test->hasExpectationOnOutput()) {
111118
$this->write($test->getActualOutput());
112119
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "A custom printer for PHPUnit.",
44
"type": "library",
55
"require": {
6-
"phpunit/phpunit": "< 6.0"
6+
"phpunit/phpunit": "^6.0"
77
},
88
"license": "MIT",
99
"authors": [

0 commit comments

Comments
 (0)