Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Jan 1, 2024
1 parent 4bf0bc6 commit 1b5c7b1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
composer.lock
/vendor
/vendor

.phpunit.result.cache
.phpunit.cache
1 change: 0 additions & 1 deletion .phpunit.result.cache

This file was deleted.

8 changes: 5 additions & 3 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<?xml version="1.0"?>
<phpunit
bootstrap="vendor/autoload.php"
colors="true"
verbose="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="vendor/autoload.php" colors="true"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
cacheDirectory=".phpunit.cache"
>
<testsuite name="all">
<directory>tests</directory>
Expand Down
13 changes: 5 additions & 8 deletions tests/CommandLine/WorkerCommandLineFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Symplify\EasyParallel\Tests\CommandLine;

use Iterator;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\ArrayInput;
Expand Down Expand Up @@ -38,11 +39,10 @@ protected function setUp(): void
}

/**
* @dataProvider provideData()
*
* @param class-string<Command> $commandClass
* @param array<string, mixed> $inputParameters
*/
#[DataProvider('provideData')]
public function test(
string $commandClass,
string $pathsOptionName,
Expand All @@ -66,14 +66,11 @@ public function test(
$this->assertSame($expectedCommand, $workerCommandLine);
}

/**
* @return Iterator<array<int, array<string, string|string[]|bool>>|string[]>
*/
public function provideData(): Iterator
public static function provideData(): Iterator
{
$cliInputOptions = array_slice($_SERVER['argv'], 1);

$expectedCommandLinesString = $this->createExpectedCommandLinesString($cliInputOptions);
$expectedCommandLinesString = self::createExpectedCommandLinesString($cliInputOptions);

yield [
MainCommand::class,
Expand Down Expand Up @@ -119,7 +116,7 @@ private function prepareProcessCommandDefinition(string $mainCommandClass): Inpu
/**
* @param string[] $cliInputOptions
*/
private function createExpectedCommandLinesString(array $cliInputOptions): string
private static function createExpectedCommandLinesString(array $cliInputOptions): string
{
$commandLineString = "'" . PHP_BINARY . "' '" . self::DUMMY_MAIN_SCRIPT . "'";

Expand Down

0 comments on commit 1b5c7b1

Please sign in to comment.