Skip to content

Commit

Permalink
Fix --functional progress output without a dataProvider (#842)
Browse files Browse the repository at this point in the history
  • Loading branch information
ax-ml authored Feb 20, 2024
1 parent cf4e141 commit 64fcfd0
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/WrapperRunner/SuiteLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ public function __construct(
$name .= '@' . $dataName;
}
}
} else {
$name = sprintf('/%s$/', $name);
}

$tests[] = "$file\0$name";
Expand Down
22 changes: 22 additions & 0 deletions test/Unit/WrapperRunner/WrapperRunnerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,28 @@ public function testFunctionalParallelization(): void
Time: %s, Memory: %s MB
OK%a
EOF;
self::assertStringMatchesFormat($expectedOutput, $runnerResult->output);
self::assertSame(RunnerInterface::SUCCESS_EXIT, $runnerResult->exitCode);
}

#[RequiresPhp('8.2')]
public function testSameBeginningOfName(): void
{
$this->bareOptions['path'] = $this->fixture('same_beginning_of_name');
$this->bareOptions['--functional'] = true;

$runnerResult = $this->runRunner();

$expectedOutput = <<<'EOF'
Processes: 2
Runtime: PHP %s
.... 4 / 4 (100%)
Time: %s, Memory: %s MB
OK%a
EOF;
self::assertStringMatchesFormat($expectedOutput, $runnerResult->output);
Expand Down
31 changes: 31 additions & 0 deletions test/fixtures/same_beginning_of_name/SameBeginningOfNameTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

declare(strict_types=1);

namespace ParaTest\Tests\fixtures\same_beginning_of_name;

use PHPUnit\Framework\TestCase;

/** @internal */
final class SameBeginningOfNameTest extends TestCase
{
public function testSame(): void
{
self::assertTrue(true);
}

public function testSameBeginning(): void
{
self::assertTrue(true);
}

public function testSameBeginningOf(): void
{
self::assertTrue(true);
}

public function testSameBeginningOfName(): void
{
self::assertTrue(true);
}
}

0 comments on commit 64fcfd0

Please sign in to comment.