Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone committed Sep 20, 2023
1 parent fea6730 commit 2b0cea9
Show file tree
Hide file tree
Showing 10 changed files with 159 additions and 16 deletions.
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
*.sh linguist-language=PHP

# Ignore following folder/file.
/bin export-ignore
/workbench export-ignore
/.github export-ignore
/.coveralls.yml export-ignore
/.gitattributes export-ignore
Expand All @@ -10,7 +12,7 @@
/.travis.yml export-ignore
/phpunit9.xml export-ignore
/phpunit.xml export-ignore
/sync.sh export-ignore
/testbench.yaml export-ignore
/CHANGELOG-*.md export-ignore
/CODE_OF_CONDUCT.md export-ignore
/CONTRIBUTING.md export-ignore
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
- "ubuntu-latest"
php:
- 8.2
- 8.3
phpunit:
- "~10.3.0"
- "~10.2.0"
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG-7.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@

This changelog references the relevant changes (bug and security fixes) done to `orchestra/testbench`.

## 7.31.0

Released: 2023-09-19

### Changes

* Update minimum support for Testbench Core v7.31.0+. ([v7.30.0...v7.31.0](https://github.com/orchestral/testbench-core/compare/v7.30.0...v7.31.0))
* Update minimum support for Workbench 0.3.0+.

#### Testbench Changes

##### Added

* Added methods to `Orchestra\Testbench\Concerns\InteractsWithPublishedFiles` trait:
- `assertMigrationFileExists`.
- `assertMigrationFileNotExists`.

##### Changes

* Allow passing wildcard filenames to `Orchestra\Testbench\Concerns\InteractsWithPublishedFiles::$files` property.
* Allow using custom directory on `assertMigrationFileContains` and `assertMigrationFileNotContains` from `Orchestra\Testbench\Concerns\InteractsWithPublishedFiles` trait.
* Rename methods in `Orchestra\Testbench\Concerns\InteractsWithPublishedFiles` trait:
- `cleanUpFiles` to `cleanUpPublishedFiles`.
- `cleanUpMigrationFiles` to `cleanUpPublishedMigrationFiles`.
- `getMigrationFile` to `findFirstPublishedMigrationFile`.

## 7.30.0

Released: 2023-08-29
Expand Down
50 changes: 50 additions & 0 deletions CHANGELOG-8.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,56 @@

This changelog references the relevant changes (bug and security fixes) done to `orchestra/testbench`.

## 8.11.1

Released: 2023-09-20

### Changes

* Support Laravel Framework `10.24`.
* Update minimum support for Testbench Core v8.11.1+. ([v8.11.0...v8.11.1](https://github.com/orchestral/testbench-core/compare/v8.11.0...v8.11.1))

## 8.11.0

Released: 2023-09-19

### Changes

* Update minimum support for Laravel Framework `10.23.1`.
* Update minimum support for Testbench Core v8.11.0+. ([v8.10.0...v8.11.0](https://github.com/orchestral/testbench-core/compare/v8.10.0...v8.11.0))
* Update minimum support for Workbench 0.3.0+.

#### Testbench Changes

##### Added

* Added methods to `Orchestra\Testbench\Concerns\InteractsWithPublishedFiles` trait:
- `assertMigrationFileExists`.
- `assertMigrationFileNotExists`.

##### Changes

* Rename methods in `Orchestra\Testbench\Concerns\InteractsWithPublishedFiles` trait:
- `cleanUpFiles` to `cleanUpPublishedFiles`.
- `cleanUpMigrationFiles` to `cleanUpPublishedMigrationFiles`.
- `getMigrationFile` to `findFirstPublishedMigrationFile`.

## 8.10.2

Released: 2023-09-12

### Changes

* Support Laravel Framework `10.23`.

## 8.10.1

Released: 2023-09-05

### Changes

* Support Laravel Framework `10.22`.

## 8.10.0

Released: 2023-08-29
Expand Down
31 changes: 31 additions & 0 deletions bin/sync
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env php
<?php

$workingPath = getcwd();
$BRANCH = '9.x';

require __DIR__.'/../vendor/autoload.php';

$files = new Illuminate\Filesystem\Filesystem();

echo ">>>> Checkout branch {$BRANCH}";

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");

Illuminate\Support\Collection::make([
...$files->glob("{$workingPath}/core/workbench")
])->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"));
});
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"php": ">=8.2.0 <8.3.0",
"composer-runtime-api": "^2.2",
"fakerphp/faker": "^1.21",
"laravel/framework": "11.x-dev",
"laravel/framework": "^11.0",
"mockery/mockery": "^1.5.1",
"orchestra/testbench-core": "9.x-dev",
"orchestra/testbench-core": "^9.0",
"orchestra/workbench": "dev-next",
"phpunit/phpunit": ">=10.1.0 <10.4.0",
"symfony/process": "^6.2",
Expand Down
12 changes: 0 additions & 12 deletions sync.sh

This file was deleted.

3 changes: 3 additions & 0 deletions testbench.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@ providers:
env:
APP_NAME: "Testbench"

migrations:
- workbench/database/migrations

purge:
directories: public/vendor/*
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

use Carbon\Carbon;
use Illuminate\Database\Migrations\Migration;

return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('testbench_users', function ($table) {
$table->increments('id');
$table->string('email');
$table->string('password');

$table->timestamps();
});

$now = Carbon::now();

DB::table('testbench_users')->insert([
'email' => 'crynobone@gmail.com',
'password' => Hash::make('123'),
'created_at' => $now,
'updated_at' => $now,
]);
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('testbench_users');
}
};

0 comments on commit 2b0cea9

Please sign in to comment.