Skip to content

Commit

Permalink
fix: generate nova test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
t0xas committed May 14, 2024
1 parent 275223d commit 0c8efd1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Generators/AbstractTestsGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ protected function createDump(): void

$dumpName = $this->getDumpName();

file_put_contents($this->getFixturesPath("{$dumpName}.sql"), $content);
file_put_contents($this->getFixturesPath($dumpName), $content);

event(new SuccessCreateMessage("Created a new Test dump on path: "
. "{$this->paths['tests']}/fixtures/{$this->getTestClassName()}/{$dumpName}.sql"));
. "{$this->paths['tests']}/fixtures/{$this->getTestClassName()}/{$dumpName}"));
}

protected function getDumpName(): string
{
return 'dump';
return 'dump.sql';
}

protected function getInserts(): array
Expand Down
2 changes: 1 addition & 1 deletion src/Generators/NovaTestGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,6 @@ protected function getDumpName(): string
{
$modelName = Str::snake($this->model);

return "nova_{$modelName}_dump";
return "nova_{$modelName}_dump.sql";
}
}

0 comments on commit 0c8efd1

Please sign in to comment.