Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix --functional progress output without a dataProvider #842

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix --functional without dataProvider
ax-ml committed Feb 19, 2024
commit ae86d22d0946b02847ba1cde16f08225e93a0d48
2 changes: 2 additions & 0 deletions src/WrapperRunner/SuiteLoader.php
Original file line number Diff line number Diff line change
@@ -95,6 +95,8 @@ public function __construct(
$name .= '@' . $dataName;
}
}
} else {
$name = sprintf('/%s$/', $name);
}

$tests[] = "$file\0$name";
22 changes: 22 additions & 0 deletions test/Unit/WrapperRunner/WrapperRunnerTest.php
Original file line number Diff line number Diff line change
@@ -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);
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);
}
}