Skip to content

Commit

Permalink
Fix CS/WS issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Dec 14, 2022
1 parent fca0876 commit 121ca21
Showing 1 changed file with 49 additions and 49 deletions.
98 changes: 49 additions & 49 deletions tests/tests/Node/BuilderTest.php
Expand Up @@ -21,6 +21,55 @@ final class BuilderTest extends TestCase
{
private $factory;

public static function reducePathsProvider(): Generator
{
$s = DIRECTORY_SEPARATOR;

yield [
[],
'.',
self::pathsToProcessedDataObjectHelper([]),
];

foreach (["C:{$s}", "{$s}"] as $p) {
yield [
[
'Money.php' => [],
],
"{$p}home{$s}sb{$s}Money{$s}",
self::pathsToProcessedDataObjectHelper([
"{$p}home{$s}sb{$s}Money{$s}Money.php" => [],
]),
];

yield [
[
'Money.php' => [],
'MoneyBag.php' => [],
],
"{$p}home{$s}sb{$s}Money",
self::pathsToProcessedDataObjectHelper([
"{$p}home{$s}sb{$s}Money{$s}Money.php" => [],
"{$p}home{$s}sb{$s}Money{$s}MoneyBag.php" => [],
]),
];

yield [
[
'Money.php' => [],
'MoneyBag.php' => [],
"Cash.phar{$s}Cash.php" => [],
],
"{$p}home{$s}sb{$s}Money",
self::pathsToProcessedDataObjectHelper([
"{$p}home{$s}sb{$s}Money{$s}Money.php" => [],
"{$p}home{$s}sb{$s}Money{$s}MoneyBag.php" => [],
"phar://{$p}home{$s}sb{$s}Money{$s}Cash.phar{$s}Cash.php" => [],
]),
];
}
}

protected function setUp(): void
{
$this->factory = new Builder(new ParsingFileAnalyser(true, true));
Expand Down Expand Up @@ -206,55 +255,6 @@ public function testReducePaths(array $reducedPaths, string $commonPath, Process
$this->assertEquals($commonPath, $_commonPath);
}

public static function reducePathsProvider(): Generator
{
$s = DIRECTORY_SEPARATOR;

yield [
[],
'.',
self::pathsToProcessedDataObjectHelper([]),
];

foreach (["C:{$s}", "{$s}"] as $p) {
yield [
[
'Money.php' => [],
],
"{$p}home{$s}sb{$s}Money{$s}",
self::pathsToProcessedDataObjectHelper([
"{$p}home{$s}sb{$s}Money{$s}Money.php" => [],
]),
];

yield [
[
'Money.php' => [],
'MoneyBag.php' => [],
],
"{$p}home{$s}sb{$s}Money",
self::pathsToProcessedDataObjectHelper([
"{$p}home{$s}sb{$s}Money{$s}Money.php" => [],
"{$p}home{$s}sb{$s}Money{$s}MoneyBag.php" => [],
]),
];

yield [
[
'Money.php' => [],
'MoneyBag.php' => [],
"Cash.phar{$s}Cash.php" => [],
],
"{$p}home{$s}sb{$s}Money",
self::pathsToProcessedDataObjectHelper([
"{$p}home{$s}sb{$s}Money{$s}Money.php" => [],
"{$p}home{$s}sb{$s}Money{$s}MoneyBag.php" => [],
"phar://{$p}home{$s}sb{$s}Money{$s}Cash.phar{$s}Cash.php" => [],
]),
];
}
}

private static function pathsToProcessedDataObjectHelper(array $paths): ProcessedCodeCoverageData
{
$coverage = new ProcessedCodeCoverageData;
Expand Down

0 comments on commit 121ca21

Please sign in to comment.