Skip to content

Commit d877c91

Browse files
authored
Merge pull request #1 from soap/develop
Develop
2 parents 2a28cb9 + 3db91e1 commit d877c91

17 files changed

+56
-47
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ coverage
66
docs
77
phpunit.xml
88
phpstan.neon
9-
testbench.yaml
109
vendor
1110
node_modules

canvas.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
preset: package
22

33
namespace: Soap\WorkflowStorage
4-
user-auth-model: App\Models\User
4+
user-auth-model:
55

66
paths:
77
src: src

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
"autoload-dev": {
4545
"psr-4": {
4646
"Soap\\WorkflowStorage\\Tests\\": "tests/",
47-
"Soap\\WorkflowStorage\\Tests\\Database\\Factories\\": "tests/database/factories/",
48-
"Workbench\\App\\": "workbench/app/"
47+
"Workbench\\App\\": "workbench/app/",
48+
"Workbench\\Database\\Factories\\": "workbench/database/factories/"
4949
}
5050
},
5151
"scripts": {

src/WorkflowStorageServiceProvider.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ public function configurePackage(Package $package): void
1919
->name('laravel-workflow-storage')
2020
->hasConfigFile()
2121
->hasMigrations([
22-
'create_workflows_table',
23-
'create_workflow_states_table',
24-
'create_workflow_transitions_table',
25-
'create_workflow_state_transitions_table',
22+
'01_create_workflows_table',
23+
'02_create_workflow_states_table',
24+
'03_create_workflow_transitions_table',
25+
'04_create_workflow_state_transitions_table',
2626
])
2727
->hasCommand(WorkflowStorageListCommand::class);
2828
}

testbench.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
providers:
2+
# - Workbench\App\Providers\WorkbenchServiceProvider
3+
4+
migrations:
5+
- workbench/database/migrations
6+
7+
seeders:
8+
- Workbench\Database\Seeders\DatabaseSeeder
9+
10+
workbench:
11+
start: '/'
12+
install: true
13+
health: false
14+
discovers:
15+
web: true
16+
api: false
17+
commands: false
18+
components: false
19+
views: false
20+
build: []
21+
assets: []
22+
sync: []

tests/TestCase.php

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,33 @@
55
use Illuminate\Database\Eloquent\Factories\Factory;
66
use Illuminate\Foundation\Testing\RefreshDatabase;
77
use Illuminate\Support\Str;
8+
use Orchestra\Testbench\Concerns\WithWorkbench;
89
use Orchestra\Testbench\TestCase as Orchestra;
910
use Soap\WorkflowStorage\WorkflowStorageServiceProvider;
1011

12+
use function Orchestra\Testbench\workbench_path;
13+
1114
class TestCase extends Orchestra
1215
{
1316
use RefreshDatabase;
17+
use WithWorkbench;
1418

1519
protected function setUp(): void
1620
{
1721
parent::setUp();
1822

1923
Factory::guessFactoryNamesUsing(function (string $modelName) {
20-
if (Str::startsWith($modelName, 'Soap\\WorkflowStorage\\Tests\\Models\\')) {
24+
if (Str::startsWith($modelName, 'Workbench\\App\\Models\\')) {
2125
// Factories within the tests directory
22-
return 'Soap\\WorkflowStorage\\Tests\\Database\\Factories\\'.class_basename($modelName).'Factory';
26+
return 'Workbench\\Database\\Factories\\'.class_basename($modelName).'Factory';
2327
}
2428

2529
// Factories within the package directory
2630
return 'Soap\\WorkflowStorage\\Database\\Factories\\'.class_basename($modelName).'Factory';
2731

2832
});
29-
$this->artisan('vendor:publish --tag="workflow-storage-migrations"');
30-
$this->loadMigrationsFrom(__DIR__.'/database/migrations'); // load the test migrations
31-
//$this->loadMigrationsFrom(__DIR__.'/../database/migrations'); // load the package migrations
33+
34+
$this->loadMigrationsFrom(__DIR__.'/../database/migrations'); // load the package migrations
3235
}
3336

3437
protected function getPackageProviders($app)
@@ -38,12 +41,17 @@ protected function getPackageProviders($app)
3841
];
3942
}
4043

41-
public function getEnvironmentSetUp($app)
42-
{
44+
public function getEnvironmentSetUp($app) {}
4345

44-
//include_once __DIR__.'/database/migrations/01_20240912_create_users_table.php';
45-
//(new \CreateUsersTable())->up();
46-
//include_once __DIR__.'/database/migrations/02_20240912_create_orders_table.php';
47-
//(new \CreateOrdersTable())->up();
46+
/**
47+
* Define database migrations.
48+
*
49+
* @return void
50+
*/
51+
protected function defineDatabaseMigrations()
52+
{
53+
$this->loadMigrationsFrom(
54+
workbench_path('database/migrations')
55+
);
4856
}
4957
}

0 commit comments

Comments
 (0)