Skip to content

Commit 0f6b660

Browse files
committed
add phpunit-result-printer
1 parent e0ab54f commit 0f6b660

File tree

4 files changed

+131
-4
lines changed

4 files changed

+131
-4
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
},
1616
"require-dev":{
1717
"phpunit/phpunit": "^5.0",
18-
"overtrue/phplint": "^0.2"
18+
"overtrue/phplint": "^0.2",
19+
"codedungeon/phpunit-result-printer": "^0.5"
1920
},
2021
"autoload": {
2122
"psr-4": {

composer.lock

Lines changed: 118 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpunit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<phpunit backupGlobals="false"
2+
<phpunit printerClass="Codedungeon\PHPUnitPrettyResultPrinter\Printer" backupGlobals="false"
33
backupStaticAttributes="false"
44
colors="true"
55
convertErrorsToExceptions="true"

tests/ColorTest/CliColorTest.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public function createServer()
1212
return new Colors();
1313
}
1414

15-
public function testCliColor()
15+
public function testColoredString()
1616
{
1717
$color = $this->createServer();
1818
$res = $color->getColoredString("Testing Colors class, this is purple string on yellow background.",
@@ -34,4 +34,13 @@ public function testGetForegroundColors(){
3434
$this->assertNotEmpty($colors);
3535
}
3636

37+
public function testInitColoredString()
38+
{
39+
$color = $this->createServer();
40+
$string =$color::initColoredString('hello php');
41+
$this->assertEquals('hello php', $string);
42+
}
43+
44+
45+
3746
}

0 commit comments

Comments
 (0)