Skip to content

Commit

Permalink
Code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
cedx committed Apr 20, 2024
1 parent feebec7 commit ea3d2f0
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 34 deletions.
6 changes: 2 additions & 4 deletions test/BranchCoverageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#[TestDox("BranchCoverage")]
final class BranchCoverageTest extends TestCase {

#[Test]
#[TestDox("fromJson()")]
#[Test, TestDox("fromJson()")]
function fromJson(): void {
// It should return an instance with default values for an empty map.
$coverage = BranchCoverage::fromJson(new \stdClass);
Expand All @@ -30,8 +29,7 @@ function fromJson(): void {
assertThat($data->lineNumber, equalTo(127));
}

#[Test]
#[TestDox("__toString()")]
#[Test, TestDox("__toString()")]
function testToString(): void {
// It should return a format like 'BRF:<found>\\nBRH:<hit>'.
assertThat((string) new BranchCoverage, equalTo(strtr("BRF:0{eol}BRH:0", ["{eol}" => PHP_EOL])));
Expand Down
6 changes: 2 additions & 4 deletions test/BranchDataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#[TestDox("BranchData")]
final class BranchDataTest extends TestCase {

#[Test]
#[TestDox("fromJson()")]
#[Test, TestDox("fromJson()")]
function fromJson(): void {
// It should return an instance with default values for an empty map.
$data = BranchData::fromJson(new \stdClass);
Expand All @@ -28,8 +27,7 @@ function fromJson(): void {
assertThat($data->taken, equalTo(1));
}

#[Test]
#[TestDox("__toString()")]
#[Test, TestDox("__toString()")]
function testToString(): void {
// It should return a format like 'BRDA:<lineNumber>,<blockNumber>,<branchNumber>,<taken>'.
assertThat((string) new BranchData, equalTo("BRDA:0,0,0,-"));
Expand Down
6 changes: 2 additions & 4 deletions test/FunctionCoverageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#[TestDox("FunctionCoverage")]
final class FunctionCoverageTest extends TestCase {

#[Test]
#[TestDox("fromJson()")]
#[Test, TestDox("fromJson()")]
function fromJson(): void {
// It should return an instance with default values for an empty map.
$coverage = FunctionCoverage::fromJson(new \stdClass);
Expand All @@ -30,8 +29,7 @@ function fromJson(): void {
assertThat($data->lineNumber, equalTo(127));
}

#[Test]
#[TestDox("__toString()")]
#[Test, TestDox("__toString()")]
function testToString(): void {
// It should return a format like 'FNF:<found>\\nFNH:<hit>'.
assertThat((string) new FunctionCoverage, equalTo(strtr("FNF:0{eol}FNH:0", ["{eol}" => PHP_EOL])));
Expand Down
6 changes: 2 additions & 4 deletions test/FunctionDataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#[TestDox("FunctionData")]
final class FunctionDataTest extends TestCase {

#[Test]
#[TestDox("fromJson()")]
#[Test, TestDox("fromJson()")]
function fromJson(): void {
// It should return an instance with default values for an empty map.
$data = FunctionData::fromJson(new \stdClass);
Expand All @@ -26,8 +25,7 @@ function fromJson(): void {
assertThat($data->lineNumber, equalTo(127));
}

#[Test]
#[TestDox("toString()")]
#[Test, TestDox("toString()")]
function testToString(): void {
// It should return a format like 'FN:<lineNumber>,<functionName>' when used as definition.
assertThat((new FunctionData)->toString(true), equalTo("FN:0,"));
Expand Down
6 changes: 2 additions & 4 deletions test/LineCoverageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#[TestDox("LineCoverage")]
final class LineCoverageTest extends TestCase {

#[Test]
#[TestDox("fromJson()")]
#[Test, TestDox("fromJson()")]
function fromJson(): void {
// It should return an instance with default values for an empty map.
$coverage = LineCoverage::fromJson(new \stdClass);
Expand All @@ -30,8 +29,7 @@ function fromJson(): void {
assertThat($data->lineNumber, equalTo(127));
}

#[Test]
#[TestDox("__toString()")]
#[Test, TestDox("__toString()")]
function testToString(): void {
// It should return a format like 'LF:<found>\\nLH:<hit>'.
assertThat((string) new LineCoverage, equalTo(strtr("LF:0{eol}LH:0", ["{eol}" => PHP_EOL])));
Expand Down
6 changes: 2 additions & 4 deletions test/LineDataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#[TestDox("LineData")]
final class LineDataTest extends TestCase {

#[Test]
#[TestDox("fromJson()")]
#[Test, TestDox("fromJson()")]
function fromJson(): void {
// It should return an instance with default values for an empty map.
$data = LineData::fromJson(new \stdClass);
Expand All @@ -26,8 +25,7 @@ function fromJson(): void {
assertThat($data->lineNumber, equalTo(127));
}

#[Test]
#[TestDox("__toString()")]
#[Test, TestDox("__toString()")]
function testToString(): void {
// It should return a format like 'DA:<lineNumber>,<executionCount>[,<checksum>]'.
assertThat((string) new LineData, equalTo("DA:0,0"));
Expand Down
9 changes: 3 additions & 6 deletions test/ReportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#[TestDox("Report")]
final class ReportTest extends TestCase {

#[Test]
#[TestDox("fromJson()")]
#[Test, TestDox("fromJson()")]
function fromJson(): void {
// It should return an instance with default values for an empty map.
$report = Report::fromJson(new \stdClass);
Expand All @@ -25,8 +24,7 @@ function fromJson(): void {
assertThat($report->testName, equalTo("LcovTest"));
}

#[Test]
#[TestDox("parse()")]
#[Test, TestDox("parse()")]
function parse(): void {
$report = Report::parse(file_get_contents("res/lcov.info") ?: "");

Expand Down Expand Up @@ -78,8 +76,7 @@ function parse(): void {
Report::parse("TN:Example");
}

#[Test]
#[TestDox("__toString()")]
#[Test, TestDox("__toString()")]
function testToString(): void {
// It should return a format like 'TN:<testName>'.
assertThat((string) new Report(""), isEmpty());
Expand Down
6 changes: 2 additions & 4 deletions test/SourceFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#[TestDox("SourceFile")]
final class SourceFileTest extends TestCase {

#[Test]
#[TestDox("fromJson()")]
#[Test, TestDox("fromJson()")]
function fromJson(): void {
// It should return an instance with default values for an empty map.
$sourceFile = SourceFile::fromJson(new \stdClass);
Expand All @@ -34,8 +33,7 @@ function fromJson(): void {
assertThat($sourceFile->path, equalTo("/home/cedx/lcov.php"));
}

#[Test]
#[TestDox("__toString()")]
#[Test, TestDox("__toString()")]
function testToString(): void {
// It should return a format like 'SF:<path>\\nend_of_record'.
assertThat((string) new SourceFile(""), equalTo(strtr("SF:{eol}end_of_record", ["{eol}" => PHP_EOL])));
Expand Down

0 comments on commit ea3d2f0

Please sign in to comment.