Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed May 21, 2024
1 parent 96ca77e commit adc857d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
4 changes: 3 additions & 1 deletion src/Foundation/Console/Concerns/InteractsWithIO.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Orchestra\Testbench\Foundation\Console\Concerns;

use function Orchestra\Testbench\package_path;

/**
* @deprecated
*/
Expand All @@ -19,7 +21,7 @@ trait InteractsWithIO
protected function copyTaskCompleted(string $from, string $to, string $type, ?string $workingPath = null): void
{
/** @phpstan-ignore-next-line constant.notFound */
$workingPath = $workingPath ?? TESTBENCH_WORKING_PATH;
$workingPath = $workingPath ?? package_path();

$from = str_replace($workingPath.'/', '', (string) realpath($from));

Expand Down
5 changes: 3 additions & 2 deletions src/Foundation/Console/ServeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

use function Orchestra\Testbench\package_path;

class ServeCommand extends Command
{
/**
Expand All @@ -27,8 +29,7 @@ class_exists(ComposerConfig::class, false)
ComposerConfig::disableProcessTimeout();
}

/** @phpstan-ignore-next-line constant.notFound */
$_ENV['TESTBENCH_WORKING_PATH'] = TESTBENCH_WORKING_PATH;
$_ENV['TESTBENCH_WORKING_PATH'] = package_path();

static::$passthroughVariables[] = 'TESTBENCH_WORKING_PATH';

Expand Down
4 changes: 2 additions & 2 deletions src/Foundation/Console/TestCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ protected function phpunitEnvironmentVariables()
->merge([
'APP_ENV' => 'testing',
'TESTBENCH_PACKAGE_TESTER' => '(true)',
'TESTBENCH_WORKING_PATH' => TESTBENCH_WORKING_PATH,
'TESTBENCH_WORKING_PATH' => package_path(),
'TESTBENCH_APP_BASE_PATH' => $this->laravel->basePath(),
])->merge(parent::phpunitEnvironmentVariables())
->all();
Expand All @@ -143,7 +143,7 @@ protected function paratestEnvironmentVariables()
->merge([
'APP_ENV' => 'testing',
'TESTBENCH_PACKAGE_TESTER' => '(true)',
'TESTBENCH_WORKING_PATH' => TESTBENCH_WORKING_PATH,
'TESTBENCH_WORKING_PATH' => package_path(),
'TESTBENCH_APP_BASE_PATH' => $this->laravel->basePath(),
])->merge(parent::paratestEnvironmentVariables())
->all();
Expand Down
6 changes: 3 additions & 3 deletions src/Foundation/TestbenchServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use Illuminate\Support\ServiceProvider;
use NunoMaduro\Collision\Adapters\Laravel\Commands\TestCommand as CollisionTestCommand;

use function Orchestra\Testbench\package_path;

class TestbenchServiceProvider extends ServiceProvider
{
/**
Expand All @@ -16,11 +18,9 @@ class TestbenchServiceProvider extends ServiceProvider
*/
public function register()
{
$workingPath = \defined('TESTBENCH_WORKING_PATH') ? TESTBENCH_WORKING_PATH : null;

AboutCommand::add('Testbench', fn () => [
'Core Version' => class_exists(InstalledVersions::class) ? InstalledVersions::getPrettyVersion('orchestra/testbench-core') : '<fg=yellow;options=bold>-</>',
'Skeleton Path' => str_replace($workingPath, '', $this->app->basePath()),
'Skeleton Path' => str_replace(package_path(), '', $this->app->basePath()),
]);
}

Expand Down

0 comments on commit adc857d

Please sign in to comment.