Skip to content

Commit

Permalink
Merge branch '8.x' into 9.x
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Aug 14, 2024
2 parents e617364 + 892f2d1 commit 9e5f33e
Show file tree
Hide file tree
Showing 10 changed files with 105 additions and 42 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: |
Expand Down
4 changes: 0 additions & 4 deletions .gitmodules

This file was deleted.

19 changes: 19 additions & 0 deletions CHANGELOG-8.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 13 additions & 21 deletions bin/sync
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
18 changes: 11 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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",
Expand All @@ -41,9 +48,6 @@
"@test"
]
},
"config": {
"sort-packages": true
},
"prefer-stable": true,
"minimum-stability": "dev"
}
1 change: 0 additions & 1 deletion core
Submodule core deleted from 63d3bc
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
backupStaticProperties="false">
<testsuites>
<testsuite name="Testbench Test Suite">
<directory suffix="Test.php">./core/tests/</directory>
<directory suffix="Test.php">./vendor/orchestra/testbench-core/tests/</directory>
</testsuite>
</testsuites>
<groups>
Expand Down
8 changes: 3 additions & 5 deletions workbench/app/Providers/WorkbenchServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class WorkbenchServiceProvider extends ServiceProvider
*
* @return void
*/
public function register()
public function register(): void
{
$this->loadMigrationsFrom(realpath(__DIR__.'/../../database/migrations'));
}
Expand All @@ -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'));
});
}
}
39 changes: 39 additions & 0 deletions workbench/database/factories/UserFactory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

namespace Workbench\Database\Factories;

use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;

class UserFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'name' => $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,
];
});
}
}
18 changes: 18 additions & 0 deletions workbench/database/seeders/DatabaseSeeder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace Workbench\Database\Seeders;

use Illuminate\Database\Seeder;

class DatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
//
}
}

0 comments on commit 9e5f33e

Please sign in to comment.