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 Dec 27, 2023
1 parent fe457bb commit 7166eac
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tests/Feature/GeneratorPresetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,29 @@
use Orchestra\Testbench\TestCase;
use PHPUnit\Framework\Attributes\Test;

use function Illuminate\Filesystem\join_paths;

class GeneratorPresetTest extends TestCase
{
use WithWorkbench;

#[Test]
public function it_can_be_resolved_and_has_correct_signature_as_laravel_preset()
{
$workingPath = realpath(__DIR__.'/../../vendor/orchestra/testbench-core/laravel');
$workingPath = realpath(join_paths(__DIR__, '..', '..', 'vendor', 'orchestra', 'testbench-core', 'laravel'));

$preset = $this->app[PresetManager::class]->driver('canvas');

$this->assertInstanceOf(Preset::class, $preset);
$this->assertSame('canvas', $preset->name());

$this->assertSame("{$workingPath}", $preset->basePath());
$this->assertSame("{$workingPath}/app", $preset->sourcePath());
$this->assertSame("{$workingPath}/resources", $preset->resourcePath());
$this->assertSame("{$workingPath}/resources/views", $preset->viewPath());
$this->assertSame("{$workingPath}/database/factories", $preset->factoryPath());
$this->assertSame("{$workingPath}/database/migrations", $preset->migrationPath());
$this->assertSame("{$workingPath}/database/seeders", $preset->seederPath());
$this->assertSame($workingPath, $preset->basePath());
$this->assertSame(join_paths($workingPath, 'app'), $preset->sourcePath());
$this->assertSame(join_paths($workingPath, 'resources'), $preset->resourcePath());
$this->assertSame(join_paths($workingPath, 'resources', 'views'), $preset->viewPath());
$this->assertSame(join_paths($workingPath, 'database', 'factories'), $preset->factoryPath());
$this->assertSame(join_paths($workingPath, 'database', 'migrations'), $preset->migrationPath());
$this->assertSame(join_paths($workingPath, 'database', 'seeders'), $preset->seederPath());

$this->assertSame('App\\', $preset->rootNamespace());
$this->assertSame('App\Console\Commands\\', $preset->commandNamespace());
Expand Down

0 comments on commit 7166eac

Please sign in to comment.