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

Commit 7e457c3

Browse files
authored
Merge pull request #2 from skyzyx/feature/phpunit7
Feature/phpunit7
2 parents 56d71d3 + 0b29770 commit 7e457c3

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/vendor/
2+
composer.lock

ResultPrinter.php

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<?php
22
/**
3-
* Copyright (c) 2014-2017 Ryan Parman
3+
* Copyright (c) 2014-2018 Ryan Parman <http://ryanparman.com>
44
*/
5-
65
namespace Skyzyx\ResultPrinter;
76

87
use PHPUnit\Extensions\PhptTestCase;
@@ -38,7 +37,7 @@ class ResultPrinter extends PPrinter
3837
/**
3938
* {@inheritdoc}
4039
*/
41-
protected function writeProgress($progress)
40+
protected function writeProgress($progress): void
4241
{
4342
switch ($progress) {
4443
case 'E':
@@ -62,6 +61,7 @@ protected function writeProgress($progress)
6261
default:
6362
$icon = $progress;
6463
}
64+
6565
$this->column++;
6666
$this->numTestsRun++;
6767

@@ -78,7 +78,7 @@ protected function writeProgress($progress)
7878
/**
7979
* {@inheritdoc}
8080
*/
81-
public function startTestSuite(TestSuite $suite)
81+
public function startTestSuite(TestSuite $suite): void
8282
{
8383
if ($this->numTests == -1) {
8484
$this->numTests = count($suite);
@@ -90,15 +90,18 @@ public function startTestSuite(TestSuite $suite)
9090
/**
9191
* {@inheritdoc}
9292
*/
93-
public function endTest(Test $test, $time)
93+
public function endTest(Test $test, $time): void
9494
{
9595
$test_name = TestUtil::describe($test);
9696

9797
if (!empty($test_name)) {
98-
$this->test_name_status = sprintf("%s (%s)\n",
99-
$test_name,
98+
$this->test_name_status = sprintf(
99+
"%s::%s (%s)\n",
100+
$test_name[0],
101+
$test_name[1],
100102
sprintf("%s ms",
101-
round($time * 1000)));
103+
round($time * 1000))
104+
);
102105
}
103106

104107
if (!$this->lastTestFailed) {
@@ -123,8 +126,8 @@ public function endTest(Test $test, $time)
123126
/**
124127
* {@inheritdoc}
125128
*/
126-
protected function writeProgressWithColor($color, $buffer)
129+
protected function writeProgressWithColor($color, $buffer): void
127130
{
128-
return $this->writeProgress($buffer);
131+
$this->writeProgress($buffer);
129132
}
130133
}

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"description": "A custom printer for PHPUnit.",
44
"type": "library",
55
"require": {
6-
"php": ">=7.0",
7-
"phpunit/phpunit": "^6.0 || ^7.0"
6+
"php": ">=7.1",
7+
"phpunit/phpunit": "^7.0"
88
},
99
"license": "MIT",
1010
"authors": [

0 commit comments

Comments
 (0)