diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml
index 82be3b4..751c754 100644
--- a/.github/workflows/tests.yaml
+++ b/.github/workflows/tests.yaml
@@ -32,8 +32,6 @@ jobs:
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v4
- with:
- submodules: recursive
- name: Setup PHP
uses: shivammathur/setup-php@v2
@@ -46,7 +44,7 @@ jobs:
uses: "ramsey/composer-install@v3"
with:
dependency-versions: "${{ matrix.dependencies }}"
- composer-options: "--prefer-dist --no-cache --with=phpunit/phpunit:${{ matrix.phpunit }}"
+ composer-options: "--no-cache --with=phpunit/phpunit:${{ matrix.phpunit }}"
- name: Installed dependencies
run: |
diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index 3c798fe..0000000
--- a/.gitmodules
+++ /dev/null
@@ -1,4 +0,0 @@
-[submodule "core"]
- path = core
- url = https://github.com/orchestral/testbench-core.git
- branch = 9.x
diff --git a/CHANGELOG-8.x.md b/CHANGELOG-8.x.md
index 8fc5481..09b74eb 100644
--- a/CHANGELOG-8.x.md
+++ b/CHANGELOG-8.x.md
@@ -2,6 +2,25 @@
This changelog references the relevant changes (bug and security fixes) done to `orchestra/testbench`.
+## 8.25.0
+
+Released: 2024-08-14
+
+### Changes
+
+* Update minimum support for Testbench Core v8.26.0+. ([v8.25.0...v8.26.0](https://github.com/orchestral/testbench-core/compare/v8.25.0...v8.26.0))
+
+#### Testbench Changes
+
+##### Changes
+
+* Update `Orchestra\Testbench\Foundation\Console\Actions\GeneratesFile` to remove `.gitkeep` file when directory contain one or more files.
+* Code Improvements.
+
+##### Fixes
+
+* Fixes `InteractsWithPublishedFiles` should only flush published files within `database/migrations` directory.
+
## 8.24.0
Released: 2024-07-13
diff --git a/bin/sync b/bin/sync
index a346101..cf459f6 100755
--- a/bin/sync
+++ b/bin/sync
@@ -10,37 +10,29 @@ $files = new Illuminate\Filesystem\Filesystem();
echo ">>>> Checkout branch {$BRANCH}".PHP_EOL;
-Illuminate\Support\Collection::make([
- "git checkout {$BRANCH}",
- "git submodule init",
- "git submodule foreach git reset --hard HEAD",
- "git submodule foreach git checkout $BRANCH",
- "git submodule foreach git pull",
-])->each(function ($command) use ($workingPath) {
- Symfony\Component\Process\Process::fromShellCommandline($command, $workingPath)->mustRun();
-});
-
-$files->copy("{$workingPath}/core/testbench.yaml", "{$workingPath}/testbench.yaml");
+$files->copy("{$workingPath}/vendor/orchestra/testbench-core/testbench.yaml", "{$workingPath}/testbench.yaml");
Illuminate\Support\Collection::make([
- ...$files->glob("{$workingPath}/core/workbench/app/*"),
+ ...$files->allFiles("{$workingPath}/vendor/orchestra/testbench-core/workbench/app/"),
])->flatten()
->filter(fn ($file) => is_file($file))
->each(function ($file) use ($files, $workingPath) {
- $files->copy($file, "{$workingPath}/workbench".Illuminate\Support\Str::after($file, "{$workingPath}/core/workbench"));
+ $filename = "{$workingPath}/workbench".Illuminate\Support\Str::after($file, "{$workingPath}/vendor/orchestra/testbench-core/workbench");
+ $files->ensureDirectoryExists(Illuminate\Support\Str::before($filename, basename($filename)));
+ $files->copy($file, $filename);
});
Illuminate\Support\Collection::make([
...$files->glob("{$workingPath}/core/workbench/bootstrap/*"),
- ...$files->glob("{$workingPath}/core/workbench/config/*.php"),
- ...$files->glob("{$workingPath}/core/workbench/config/*/*.php"),
- ...$files->glob("{$workingPath}/core/workbench/database/migrations/*"),
- ...$files->glob("{$workingPath}/core/workbench/lang/en/*"),
- ...$files->glob("{$workingPath}/core/workbench/routes/*"),
- ...$files->glob("{$workingPath}/core/workbench/resources/views/components/*"),
- ...$files->glob("{$workingPath}/core/workbench/resources/views/*"),
+ ...$files->allFiles("{$workingPath}/vendor/orchestra/testbench-core/workbench/config/"),
+ ...$files->allFiles("{$workingPath}/vendor/orchestra/testbench-core/workbench/database/"),
+ ...$files->allFiles("{$workingPath}/vendor/orchestra/testbench-core/workbench/lang/"),
+ ...$files->allFiles("{$workingPath}/vendor/orchestra/testbench-core/workbench/routes/"),
+ ...$files->allFiles("{$workingPath}/vendor/orchestra/testbench-core/workbench/resources/"),
])->flatten()
->filter(fn ($file) => is_file($file))
->each(function ($file) use ($files, $workingPath) {
- $files->copy($file, "{$workingPath}/workbench".Illuminate\Support\Str::after($file, "{$workingPath}/core/workbench"));
+ $filename = "{$workingPath}/workbench".Illuminate\Support\Str::after($file, "{$workingPath}/vendor/orchestra/testbench-core/workbench");
+ $files->ensureDirectoryExists(Illuminate\Support\Str::before($filename, basename($filename)));
+ $files->copy($file, $filename);
});
diff --git a/composer.json b/composer.json
index d52bb13..0502eaa 100644
--- a/composer.json
+++ b/composer.json
@@ -13,10 +13,10 @@
],
"autoload-dev": {
"psr-4": {
- "Orchestra\\Testbench\\Tests\\": "core/tests/",
- "Workbench\\App\\": "core/workbench/app/",
- "Workbench\\Database\\Factories\\": "core/workbench/database/factories",
- "Workbench\\Database\\Seeders\\": "core/workbench/database/seeders"
+ "Orchestra\\Testbench\\Tests\\": "vendor/orchestra/testbench-core/tests/",
+ "Workbench\\App\\": "workbench/app/",
+ "Workbench\\Database\\Factories\\": "workbench/database/factories/",
+ "Workbench\\Database\\Seeders\\": "workbench/database/seeders/"
}
},
"require": {
@@ -32,6 +32,13 @@
"symfony/yaml": "^7.0",
"vlucas/phpdotenv": "^5.4.1"
},
+ "config": {
+ "preferred-install": {
+ "orchestra/testbench-core": "source",
+ "*": "auto"
+ },
+ "sort-packages": true
+ },
"scripts": {
"post-autoload-dump": "@prepare",
"prepare": "@php vendor/bin/testbench package:discover --ansi",
@@ -41,9 +48,6 @@
"@test"
]
},
- "config": {
- "sort-packages": true
- },
"prefer-stable": true,
"minimum-stability": "dev"
}
diff --git a/core b/core
deleted file mode 160000
index 63d3bc4..0000000
--- a/core
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 63d3bc427fe0d9a1ba724d965742f41718c07dd3
diff --git a/phpunit.xml b/phpunit.xml
index 97eb2c4..bbe0fe0 100644
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -11,7 +11,7 @@
backupStaticProperties="false">
- ./core/tests/
+ ./vendor/orchestra/testbench-core/tests/
diff --git a/workbench/app/Providers/WorkbenchServiceProvider.php b/workbench/app/Providers/WorkbenchServiceProvider.php
index 9adb042..59510ed 100644
--- a/workbench/app/Providers/WorkbenchServiceProvider.php
+++ b/workbench/app/Providers/WorkbenchServiceProvider.php
@@ -12,7 +12,7 @@ class WorkbenchServiceProvider extends ServiceProvider
*
* @return void
*/
- public function register()
+ public function register(): void
{
$this->loadMigrationsFrom(realpath(__DIR__.'/../../database/migrations'));
}
@@ -22,12 +22,10 @@ public function register()
*
* @return void
*/
- public function boot()
+ public function boot(): void
{
Route::macro('text', function (string $url, string $content) {
- return $this->get($url, function () use ($content) {
- return response($content)->header('Content-Type', 'text/plain');
- });
+ return $this->get($url, fn () => response($content)->header('Content-Type', 'text/plain'));
});
}
}
diff --git a/workbench/database/factories/UserFactory.php b/workbench/database/factories/UserFactory.php
new file mode 100644
index 0000000..718b9a1
--- /dev/null
+++ b/workbench/database/factories/UserFactory.php
@@ -0,0 +1,39 @@
+ $this->faker->name(),
+ 'email' => $this->faker->unique()->safeEmail(),
+ 'email_verified_at' => now(),
+ 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
+ 'remember_token' => Str::random(10),
+ ];
+ }
+
+ /**
+ * Indicate that the model's email address should be unverified.
+ *
+ * @return \Illuminate\Database\Eloquent\Factories\Factory
+ */
+ public function unverified()
+ {
+ return $this->state(function (array $attributes) {
+ return [
+ 'email_verified_at' => null,
+ ];
+ });
+ }
+}
diff --git a/workbench/database/seeders/DatabaseSeeder.php b/workbench/database/seeders/DatabaseSeeder.php
new file mode 100644
index 0000000..a2afdba
--- /dev/null
+++ b/workbench/database/seeders/DatabaseSeeder.php
@@ -0,0 +1,18 @@
+