Skip to content

Commit

Permalink
wip
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 19, 2023
1 parent 9bb48e6 commit c5fc475
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 9 deletions.
14 changes: 9 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,19 @@
}
},
"scripts": {
"post-autoload-dump": "@composer run prepare",
"post-autoload-dump": "@prepare",
"prepare": "@php ./vendor/bin/testbench package:discover --ansi",
"ci": [
"@composer audit",
"@composer run prepare",
"lint": [
"@php vendor/bin/phpstan analyse",
"@php vendor/bin/pint"
],
"test": "@php vendor/bin/phpunit -c ./ --color"
"test": "@php vendor/bin/phpunit -c ./ --color",
"ci": [
"@composer audit",
"@prepare",
"@lint",
"@test"
]
},
"prefer-stable": true,
"minimum-stability": "dev"
Expand Down
18 changes: 17 additions & 1 deletion src/Presets/Preset.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,26 @@ public function seederPath(): string
return sprintf(
'%s/%s',
$this->basePath(),
$this->config('seeder.path', 'database/seeds')
$this->config('seeder.path', 'database/seeders')
);
}

/**
* Databases namespace.
*/
public function databaseFactoryNamespace(): string
{
return $this->config('factory.namespace', 'Database\Factories\\');
}

/**
* Databases namespace.
*/
public function databaseSeederNamespace(): string
{
return $this->config('seeder.path', 'Database\Factories\\');
}

/**
* Sync commands to preset.
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/CommandsProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ public function it_can_setup_laravel_preset()
$this->assertSame("{$directory}/resources", $preset->resourcePath());
$this->assertSame("{$directory}/database/factories", $preset->factoryPath());
$this->assertSame("{$directory}/database/migrations", $preset->migrationPath());
$this->assertSame("{$directory}/database/seeds", $preset->seederPath());
$this->assertSame("{$directory}/database/seeders", $preset->seederPath());
}
}
2 changes: 1 addition & 1 deletion tests/Unit/Presets/LaravelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function it_has_proper_signatures()
$this->assertSame("{$directory}/resources", $preset->resourcePath());
$this->assertSame("{$directory}/database/factories", $preset->factoryPath());
$this->assertSame("{$directory}/database/migrations", $preset->migrationPath());
$this->assertSame("{$directory}/database/seeds", $preset->seederPath());
$this->assertSame("{$directory}/database/seeders", $preset->seederPath());

$this->assertFalse($preset->hasCustomStubPath());
$this->assertNull($preset->getCustomStubPath());
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Presets/PackageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function it_has_proper_signatures()
$this->assertSame("{$directory}/resources", $preset->resourcePath());
$this->assertSame("{$directory}/database/factories", $preset->factoryPath());
$this->assertSame("{$directory}/database/migrations", $preset->migrationPath());
$this->assertSame("{$directory}/database/seeds", $preset->seederPath());
$this->assertSame("{$directory}/database/seeders", $preset->seederPath());

$this->assertFalse($preset->hasCustomStubPath());
$this->assertNull($preset->getCustomStubPath());
Expand Down

0 comments on commit c5fc475

Please sign in to comment.