Skip to content

Commit

Permalink
143 add phpunit 8 support
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeerickson committed Feb 5, 2019
1 parent e11d949 commit 55ddb38
Show file tree
Hide file tree
Showing 9 changed files with 652 additions and 16 deletions.
1 change: 1 addition & 0 deletions .phpunit.result.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
C:30:"PHPUnit\Runner\TestResultCache":2965:{a:2:{s:7:"defects";a:11:{s:46:"PrinterTest::should_not_have_any_syntax_errors";i:4;s:55:"PrinterTest::should_return_full_pathname_to_config_file";i:6;s:44:"PrinterCoreTest::should_produce_syntax_error";i:4;s:31:"PrinterCoreTest::it_should_fail";i:3;s:45:"PrinterCoreTest::it_should_display_incomplete";i:2;s:42:"PrinterCoreTest::it_should_display_skipped";i:1;s:40:"PrinterCoreTest::it_should_display_risky";i:5;s:38:"FullTest::it_should_mark_as_incomplete";i:2;s:43:"FullTest::it_should_test_another_incomplete";i:2;s:50:"FullTest::it_should_display_custom_skipped_message";i:1;s:28:"FullTest::it_should_test_015";i:3;}s:5:"times";a:49:{s:46:"PrinterTest::should_not_have_any_syntax_errors";d:0.039;s:46:"PrinterTest::should_return_module_package_name";d:0.024;s:55:"PrinterTest::should_return_full_pathname_to_config_file";d:0.023;s:31:"PrinterCoreTest::it_should_pass";d:0.029;s:44:"PrinterCoreTest::should_produce_syntax_error";d:0.03;s:31:"PrinterCoreTest::it_should_fail";d:0.024;s:45:"PrinterCoreTest::it_should_display_incomplete";d:0.029;s:42:"PrinterCoreTest::it_should_display_skipped";d:0.027;s:40:"PrinterCoreTest::it_should_display_risky";d:0.024;s:25:"FullTest::test_first_test";d:0.001;s:26:"FullTest::test_second_test";d:0.001;s:28:"FullTest::it_should_test_002";d:0.001;s:28:"FullTest::it_should_test_003";d:0.001;s:28:"FullTest::it_should_test_004";d:0;s:28:"FullTest::it_should_test_005";d:0.001;s:28:"FullTest::it_should_test_006";d:0.001;s:28:"FullTest::it_should_test_007";d:0.001;s:28:"FullTest::it_should_test_008";d:0.001;s:28:"FullTest::it_should_test_009";d:0.001;s:28:"FullTest::it_should_test_010";d:0.001;s:28:"FullTest::it_should_test_011";d:0;s:28:"FullTest::it_should_test_012";d:0.001;s:28:"FullTest::it_should_test_013";d:0;s:38:"FullTest::it_should_mark_as_incomplete";d:0.001;s:43:"FullTest::it_should_test_another_incomplete";d:0.001;s:50:"FullTest::it_should_display_custom_skipped_message";d:0.001;s:28:"FullTest::it_should_test_014";d:0.001;s:28:"FullTest::it_should_test_015";d:0.002;s:28:"FullTest::it_should_test_016";d:0.001;s:28:"FullTest::it_should_test_017";d:0.001;s:28:"FullTest::it_should_test_018";d:0.001;s:28:"FullTest::it_should_test_019";d:0.001;s:28:"FullTest::it_should_test_020";d:0.001;s:28:"FullTest::it_should_test_021";d:0.001;s:28:"FullTest::it_should_test_022";d:0.001;s:28:"FullTest::it_should_test_023";d:0.001;s:28:"FullTest::it_should_test_024";d:0.001;s:28:"FullTest::it_should_test_025";d:0.001;s:28:"FullTest::it_should_test_026";d:0.001;s:28:"FullTest::it_should_test_027";d:0.001;s:28:"FullTest::it_should_test_028";d:0.001;s:28:"FullTest::it_should_test_029";d:0.001;s:28:"FullTest::it_should_test_030";d:0.001;s:28:"FullTest::it_should_test_031";d:0.001;s:28:"FullTest::it_should_test_032";d:0.001;s:30:"FirstFileTest::test_first_test";d:0.001;s:31:"FirstFileTest::test_second_test";d:0.001;s:31:"SecondFileTest::test_third_test";d:0.001;s:32:"SecondFileTest::test_fourth_test";d:0.001;}}}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CD PHPUnit Pretty Result Printer
#### Version 0.22.0
#### Version 0.26.0

Extend the default PHPUnit Result Printer with a modern, pretty printer!

Expand Down Expand Up @@ -72,7 +72,7 @@ The following options are available (along with their default values):
| `cd-printer-hide-class` | false | Hides the display of the test class name
| `cd-printer-simple-output`| false | Uses the default PHPUnit markers (but still uses Printer)
| `cd-printer-show-config`| true | Show path to used configuration file
| `cd-printer-hide-namespace`| false |Hide test class namespaces (will only show print class name)
| `cd-printer-hide-namespace`| true |Hide test class namespaces (will only show print class name)
| `cd-printer-anybar`| true |Enable AnyBar (if anybar is not installed, settings will be ignored)
| `cd-printer-anybar-port`| 1738 |Define AnyBar port number

Expand All @@ -81,7 +81,7 @@ You can customize the markers which are used for `success`, `fail`, `error`, `sk

| **Marker** | **Value** *
|---------------|----------|
| cd-pass | " " |
| cd-pass | " " |
| cd-fail | "✖ " |
| cd-error | "⚈ " |
| cd-skipped | "→ " |
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codedungeon/phpunit-result-printer",
"version": "0.25.1",
"version": "0.26.0",
"description": "PHPUnit Pretty Result Printer",
"keywords": [
"phpunit",
Expand Down Expand Up @@ -28,7 +28,7 @@
},
"require-dev": {
"spatie/phpunit-watcher": "^1.6",
"phpunit/phpunit": "7.5.*"
"phpunit/phpunit": "8.0.*"
},
"autoload": {
"psr-4": {
Expand Down
12 changes: 11 additions & 1 deletion src/Printer.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,21 @@ class Printer extends ResultPrinter70
}

$low = version_compare(Version::series(), '7.1', '>=');
$high = true; // version_compare(Version::series(),'7.1.99','<=');
$high = version_compare(Version::series(), '7.99.99', '<=');

if ($low && $high) {
class Printer extends ResultPrinter71
{
use PrinterTrait;
}
}

$low = version_compare(Version::series(), '8.0', '>=');
$high = true; // version_compare(Version::series(),'8.99.99','<=');

if ($low && $high) {
class Printer extends ResultPrinter80
{
use PrinterTrait8;
}
}
2 changes: 2 additions & 0 deletions src/PrinterTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,9 @@ private function printTestCaseStatus($color, $buffer)
}

$buffer .= ' ';

echo parent::formatWithColor($color, $buffer);

if ($this->debug) {
$this->writeNewLine();
}
Expand Down
Loading

0 comments on commit 55ddb38

Please sign in to comment.