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 16, 2023
1 parent 16766c4 commit 1d654c8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Commands/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Orchestra\Canvas\Core\Commands;

use Illuminate\Console\Concerns\CreatesMatchingTest;
use Orchestra\Canvas\Core\CodeGenerator;
use Orchestra\Canvas\Core\Contracts\GeneratesCodeListener;
use Orchestra\Canvas\Core\GeneratesCode;
Expand Down Expand Up @@ -49,6 +50,10 @@ public function __construct(Preset $preset)
{
$this->files = $preset->filesystem();

if (in_array(CreatesMatchingTest::class, class_uses_recursive($this))) {
$this->addTestOptions();

Check failure on line 54 in src/Commands/Generator.php

View workflow job for this annotation

GitHub Actions / PHP8.1 on ubuntu-latest (highest)

Call to an undefined method Orchestra\Canvas\Core\Commands\Generator::addTestOptions().
}

parent::__construct($preset);
}

Expand Down Expand Up @@ -97,6 +102,10 @@ public function codeHasBeenGenerated(string $className): int
{
$this->components->info(sprintf('%s [%s] created successfully.', $this->type, $className));

if (in_array(CreatesMatchingTest::class, class_uses_recursive($this))) {
$this->handleTestCreation($path);

Check failure on line 106 in src/Commands/Generator.php

View workflow job for this annotation

GitHub Actions / PHP8.1 on ubuntu-latest (highest)

Call to an undefined method Orchestra\Canvas\Core\Commands\Generator::handleTestCreation().

Check failure on line 106 in src/Commands/Generator.php

View workflow job for this annotation

GitHub Actions / PHP8.1 on ubuntu-latest (highest)

Undefined variable: $path
}

return static::SUCCESS;
}

Expand Down

0 comments on commit 1d654c8

Please sign in to comment.