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

[7.x] Refactors ParallelRunner and UndefinedValue class #273

Merged
merged 2 commits into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/Attributes/WithEnv.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Closure;
use Orchestra\Testbench\Contracts\Attributes\Invokable as InvokableContract;
use Orchestra\Testbench\Foundation\Env;
use Orchestra\Testbench\Foundation\UndefinedValue;
use Orchestra\Testbench\Support\UndefinedValue;

#[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
final class WithEnv implements InvokableContract
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php

namespace Orchestra\Testbench\Foundation;
namespace Orchestra\Testbench\Features;

use Orchestra\Testbench\Foundation\Env;

use function Orchestra\Testbench\container;

Expand Down
5 changes: 3 additions & 2 deletions src/Foundation/Console/TestCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Support\Collection;
use NunoMaduro\Collision\Adapters\Laravel\Commands\TestCommand as Command;
use Orchestra\Testbench\Features\ParallelRunner;
use Orchestra\Testbench\Foundation\Env;

use function Orchestra\Testbench\defined_environment_variables;
Expand Down Expand Up @@ -97,8 +98,8 @@ protected function paratestArguments($options)
return str_starts_with($option, '--configuration=')
|| str_starts_with($option, '--runner=');
})->merge([
"--configuration={$file}",
"--runner=\Orchestra\Testbench\Foundation\ParallelRunner",
\sprintf('--configuration=%s', $file),
\sprintf('--runner=%s', ParallelRunner::class),
])->all();
}

Expand Down
4 changes: 3 additions & 1 deletion src/Foundation/Env.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Orchestra\Testbench\Foundation;

use Orchestra\Testbench\Support\UndefinedValue;

/**
* @api
*/
Expand Down Expand Up @@ -47,7 +49,7 @@ public static function forget(string $key): bool
* Forward environment value.
*
* @param string $key
* @param \Orchestra\Testbench\Foundation\UndefinedValue|mixed|null $default
* @param \Orchestra\Testbench\Support\UndefinedValue|mixed|null $default
* @return mixed
*/
public static function forward(string $key, $default = null)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Orchestra\Testbench\Foundation;
namespace Orchestra\Testbench\Support;

/**
* @internal
Expand Down
4 changes: 2 additions & 2 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ function remote(array|string $command, array|string $env = [], ?bool $tty = null
*/
function once($callback): Closure
{
$response = new Foundation\UndefinedValue;
$response = new Support\UndefinedValue;

return function () use ($callback, &$response) {
if ($response instanceof Foundation\UndefinedValue) {
if ($response instanceof Support\UndefinedValue) {
$response = value($callback) ?? null;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace Orchestra\Testbench\Tests\Foundation;
namespace Orchestra\Testbench\Tests\Support;

use Orchestra\Testbench\Foundation\UndefinedValue;
use Orchestra\Testbench\Support\UndefinedValue;
use PHPUnit\Framework\TestCase;

class UndefinedValueTest extends TestCase
Expand Down
Loading