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

Feature/phpunit7 #2

Merged
merged 2 commits into from
Feb 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/vendor/
composer.lock
23 changes: 13 additions & 10 deletions ResultPrinter.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?php
/**
* Copyright (c) 2014-2017 Ryan Parman
* Copyright (c) 2014-2018 Ryan Parman <http://ryanparman.com>
*/

namespace Skyzyx\ResultPrinter;

use PHPUnit\Extensions\PhptTestCase;
Expand Down Expand Up @@ -38,7 +37,7 @@ class ResultPrinter extends PPrinter
/**
* {@inheritdoc}
*/
protected function writeProgress($progress)
protected function writeProgress($progress): void
{
switch ($progress) {
case 'E':
Expand All @@ -62,6 +61,7 @@ protected function writeProgress($progress)
default:
$icon = $progress;
}

$this->column++;
$this->numTestsRun++;

Expand All @@ -78,7 +78,7 @@ protected function writeProgress($progress)
/**
* {@inheritdoc}
*/
public function startTestSuite(TestSuite $suite)
public function startTestSuite(TestSuite $suite): void
{
if ($this->numTests == -1) {
$this->numTests = count($suite);
Expand All @@ -90,15 +90,18 @@ public function startTestSuite(TestSuite $suite)
/**
* {@inheritdoc}
*/
public function endTest(Test $test, $time)
public function endTest(Test $test, $time): void
{
$test_name = TestUtil::describe($test);

if (!empty($test_name)) {
$this->test_name_status = sprintf("%s (%s)\n",
$test_name,
$this->test_name_status = sprintf(
"%s::%s (%s)\n",
$test_name[0],
$test_name[1],
sprintf("%s ms",
round($time * 1000)));
round($time * 1000))
);
}

if (!$this->lastTestFailed) {
Expand All @@ -123,8 +126,8 @@ public function endTest(Test $test, $time)
/**
* {@inheritdoc}
*/
protected function writeProgressWithColor($color, $buffer)
protected function writeProgressWithColor($color, $buffer): void
{
return $this->writeProgress($buffer);
$this->writeProgress($buffer);
}
}
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"description": "A custom printer for PHPUnit.",
"type": "library",
"require": {
"php": ">=7.0",
"phpunit/phpunit": "^6.0 || ^7.0"
"php": ">=7.1",
"phpunit/phpunit": "^7.0"
},
"license": "MIT",
"authors": [
Expand Down