Add Workbench config

This commit is contained in:
philipp lang 2024-01-03 11:10:59 +01:00
parent 22d7841d5a
commit 17afb48028
14 changed files with 48 additions and 44 deletions

View File

@ -5,10 +5,15 @@
"license": "MIT",
"autoload": {
"psr-4": {
"Zoomyboy\\MedialibraryHelper\\Tests\\": "tests/",
"Zoomyboy\\MedialibraryHelper\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Zoomyboy\\MedialibraryHelper\\Tests\\": "tests/",
"Workbench\\App\\": "tests/workbench/app/"
}
},
"authors": [
{
"name": "Philipp Lang",
@ -28,7 +33,20 @@
},
"scripts": {
"post-autoload-dump": [
"@clear",
"@prepare",
"@php vendor/bin/testbench package:discover --ansi"
],
"clear": "@php vendor/bin/testbench package:purge-skeleton --ansi",
"prepare": "@php vendor/bin/testbench package:discover --ansi",
"build": "@php vendor/bin/testbench workbench:build --ansi",
"serve": [
"Composer\\Config::disableProcessTimeout",
"@build",
"@php vendor/bin/testbench serve"
],
"test": [
"@php vendor/bin/pest"
]
},
"config": {

17
composer.lock generated
View File

@ -8682,16 +8682,16 @@
"packages-dev": [
{
"name": "fakerphp/faker",
"version": "v1.23.0",
"version": "v1.23.1",
"source": {
"type": "git",
"url": "https://github.com/FakerPHP/Faker.git",
"reference": "e3daa170d00fde61ea7719ef47bb09bb8f1d9b01"
"reference": "bfb4fe148adbf78eff521199619b93a52ae3554b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/FakerPHP/Faker/zipball/e3daa170d00fde61ea7719ef47bb09bb8f1d9b01",
"reference": "e3daa170d00fde61ea7719ef47bb09bb8f1d9b01",
"url": "https://api.github.com/repos/FakerPHP/Faker/zipball/bfb4fe148adbf78eff521199619b93a52ae3554b",
"reference": "bfb4fe148adbf78eff521199619b93a52ae3554b",
"shasum": ""
},
"require": {
@ -8717,11 +8717,6 @@
"ext-mbstring": "Required for multibyte Unicode string functionality."
},
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "v1.21-dev"
}
},
"autoload": {
"psr-4": {
"Faker\\": "src/Faker/"
@ -8744,9 +8739,9 @@
],
"support": {
"issues": "https://github.com/FakerPHP/Faker/issues",
"source": "https://github.com/FakerPHP/Faker/tree/v1.23.0"
"source": "https://github.com/FakerPHP/Faker/tree/v1.23.1"
},
"time": "2023-06-12T08:44:38+00:00"
"time": "2024-01-02T13:46:09+00:00"
},
{
"name": "hamcrest/hamcrest-php",

7
testbench.yaml Normal file
View File

@ -0,0 +1,7 @@
providers:
- Spatie\MediaLibrary\MediaLibraryServiceProvider
- Spatie\LaravelData\LaravelDataServiceProvider
- Zoomyboy\MedialibraryHelper\ServiceProvider
migrations:
- tests/workbench/database/migrations

View File

@ -3,8 +3,8 @@
namespace Zoomyboy\MedialibraryHelper\Tests\Feature;
use Illuminate\Support\Facades\Event;
use Zoomyboy\MedialibraryHelper\Tests\Events\MediaChange;
use Zoomyboy\MedialibraryHelper\Tests\Events\MediaDestroyed;
use Workbench\App\Events\MediaChange;
use Workbench\App\Events\MediaDestroyed;
test('it deletes multiple media', function () {
$this->auth()->registerModel()->withoutExceptionHandling();

View File

@ -3,7 +3,7 @@
namespace Zoomyboy\MedialibraryHelper\Tests\Feature;
use Illuminate\Support\Facades\Event;
use Zoomyboy\MedialibraryHelper\Tests\Events\MediaChange;
use Workbench\App\Events\MediaChange;
test('it can reorder media', function () {
Event::fake();

View File

@ -3,7 +3,7 @@
namespace Zoomyboy\MedialibraryHelper\Tests\Feature;
use Illuminate\Support\Facades\Event;
use Zoomyboy\MedialibraryHelper\Tests\Events\MediaChange;
use Workbench\App\Events\MediaChange;
test('it updates a single files properties', function () {
Event::fake();

View File

@ -4,8 +4,8 @@ namespace Zoomyboy\MedialibraryHelper\Tests\Feature;
use Carbon\Carbon;
use Illuminate\Support\Facades\Event;
use Zoomyboy\MedialibraryHelper\Tests\Events\MediaChange;
use Zoomyboy\MedialibraryHelper\Tests\Events\MediaStored;
use Workbench\App\Events\MediaChange;
use Workbench\App\Events\MediaStored;
test('it uploads a single file to a single file collection', function () {
$this->auth()->registerModel();

View File

@ -4,30 +4,14 @@ namespace Zoomyboy\MedialibraryHelper\Tests;
use Illuminate\Http\File;
use Illuminate\Support\Facades\Gate;
use Orchestra\Testbench\Concerns\WithWorkbench;
use Orchestra\Testbench\TestCase as BaseTestCase;
use Spatie\LaravelData\LaravelDataServiceProvider;
use Spatie\MediaLibrary\MediaLibraryServiceProvider;
use Zoomyboy\MedialibraryHelper\ServiceProvider;
use Zoomyboy\MedialibraryHelper\Tests\Models\Post;
use Workbench\App\Models\Post;
class TestCase extends BaseTestCase
{
/**
* Define database migrations.
*/
protected function defineDatabaseMigrations(): void
{
$this->loadMigrationsFrom(__DIR__ . '/migrations');
}
protected function getPackageProviders($app): array
{
return [
ServiceProvider::class,
MediaLibraryServiceProvider::class,
LaravelDataServiceProvider::class,
];
}
use WithWorkbench;
/**
* Generate a pdf file with a filename and get path.

View File

@ -1,6 +1,6 @@
<?php
namespace Zoomyboy\MedialibraryHelper\Tests\Events;
namespace Workbench\App\Events;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace Zoomyboy\MedialibraryHelper\Tests\Events;
namespace Workbench\App\Events;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace Zoomyboy\MedialibraryHelper\Tests\Events;
namespace Workbench\App\Events;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

View File

@ -1,6 +1,6 @@
<?php
namespace Zoomyboy\MedialibraryHelper\Tests\Models;
namespace Workbench\App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Event;
@ -8,9 +8,9 @@ use Illuminate\Support\Str;
use Spatie\MediaLibrary\HasMedia;
use Spatie\MediaLibrary\InteractsWithMedia;
use Spatie\MediaLibrary\MediaCollections\Models\Media;
use Zoomyboy\MedialibraryHelper\Tests\Events\MediaChange;
use Zoomyboy\MedialibraryHelper\Tests\Events\MediaDestroyed;
use Zoomyboy\MedialibraryHelper\Tests\Events\MediaStored;
use Workbench\App\Events\MediaChange;
use Workbench\App\Events\MediaDestroyed;
use Workbench\App\Events\MediaStored;
class Post extends Model implements HasMedia
{