Skip to content

Commit

Permalink
Merge branch '7.x' into 8.x
Browse files Browse the repository at this point in the history
  • Loading branch information
crynobone committed Dec 24, 2024
2 parents 2570008 + c014788 commit dae8499
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
# Stubs
/skeleton/*
/breeze-skeleton/*

# Symlink
/workbench/storage
2 changes: 1 addition & 1 deletion src/Console/DevToolCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ protected function prepareWorkbenchDatabaseSchema(Filesystem $filesystem, string
'--force' => (bool) $this->option('force'),
]);

StubRegistrar::replaceInFile($filesystem, join_paths($workingPath, 'app', 'Providers', 'WorkbenchServiceProvider.php'));
StubRegistrar::replaceInFile($filesystem, join_paths($workingPath, 'app', 'Models', 'User.php'));

$this->callSilently('make:user-factory', [
'--preset' => 'workbench',
Expand Down
8 changes: 8 additions & 0 deletions src/Workbench.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class Workbench extends \Orchestra\Testbench\Workbench\Workbench

/**
* Get the path to the application (Laravel) folder.
*
* @no-named-arguments
*/
public static function applicationPath(array|string $path = ''): string
{
Expand All @@ -32,6 +34,8 @@ public static function applicationPath(array|string $path = ''): string
/**
* Get the path to the Laravel application skeleton.
*
* @no-named-arguments
*
* @see \Orchestra\Workbench\Workbench::applicationPath()
*/
public static function laravelPath(array|string $path = ''): string
Expand All @@ -41,6 +45,8 @@ public static function laravelPath(array|string $path = ''): string

/**
* Get the path to the package folder.
*
* @no-named-arguments
*/
public static function packagePath(array|string $path = ''): string
{
Expand All @@ -51,6 +57,8 @@ public static function packagePath(array|string $path = ''): string

/**
* Get the path to the workbench folder.
*
* @no-named-arguments
*/
public static function path(array|string $path = ''): string
{
Expand Down
3 changes: 3 additions & 0 deletions testbench.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ workbench:
sync:
- from: workbench/dist
to: public/vendor/workbench
- from: storage
to: workbench/storage
reverse: true
assets:
- workbench-assets
discovers:
Expand Down
6 changes: 6 additions & 0 deletions tests/Console/CommandTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ protected function assertCommandExecutedWithDevTool(bool $prefix = true): void
{
$workingPath = static::stubWorkingPath();

$this->assertDirectoryExists(join_paths($workingPath, 'workbench', 'app'));
$this->assertDirectoryExists(join_paths($workingPath, 'workbench', 'app', 'Models'));
$this->assertDirectoryExists(join_paths($workingPath, 'workbench', 'app', 'Providers'));
$this->assertDirectoryExists(join_paths($workingPath, 'workbench', 'database'));
$this->assertDirectoryExists(join_paths($workingPath, 'workbench', 'database', 'factories'));
$this->assertDirectoryExists(join_paths($workingPath, 'workbench', 'database', 'seeders'));

Expand Down Expand Up @@ -93,7 +95,11 @@ protected function assertCommandExecutedWithoutDevTool(bool $prefix = true): voi
$workingPath = static::stubWorkingPath();

$this->assertDirectoryDoesNotExist(join_paths($workingPath, 'workbench', 'app'));
$this->assertDirectoryDoesNotExist(join_paths($workingPath, 'workbench', 'app', 'Models'));
$this->assertDirectoryDoesNotExist(join_paths($workingPath, 'workbench', 'app', 'Providers'));
$this->assertDirectoryDoesNotExist(join_paths($workingPath, 'workbench', 'database'));
$this->assertDirectoryDoesNotExist(join_paths($workingPath, 'workbench', 'database', 'factories'));
$this->assertDirectoryDoesNotExist(join_paths($workingPath, 'workbench', 'database', 'seeders'));
}

/**
Expand Down

0 comments on commit dae8499

Please sign in to comment.