Skip to content

Commit

Permalink
Merge pull request #126 from RonasIT/fix-documentation-creation
Browse files Browse the repository at this point in the history
fix: documentation creates only for the last test case
  • Loading branch information
DenTray committed May 2, 2024
2 parents 4c3a0c9 + 2a7c925 commit a9b2d6a
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,24 @@
namespace RonasIT\Support\AutoDoc\Tests\PhpUnitEventSubscribers;

use Illuminate\Contracts\Console\Kernel;
use Illuminate\Foundation\Application;
use PHPUnit\Event\Test\AfterLastTestMethodFinished;
use PHPUnit\Event\Test\AfterLastTestMethodFinishedSubscriber;
use PHPUnit\Event\Application\Finished;
use PHPUnit\Event\Application\FinishedSubscriber;
use RonasIT\Support\AutoDoc\Services\SwaggerService;

final class SwaggerSaveDocumentationSubscriber implements AfterLastTestMethodFinishedSubscriber
final class SwaggerSaveDocumentationSubscriber implements FinishedSubscriber
{
public function notify(AfterLastTestMethodFinished $event): void
public function notify(Finished $event): void
{
$this->createApplication();

app(SwaggerService::class)->saveProductionData();
}

protected function createApplication(): Application
protected function createApplication(): void
{
$app = require base_path('bootstrap/app.php');

$app->loadEnvironmentFrom('.env.testing');
$app->make(Kernel::class)->bootstrap();

return $app;
}
}
}

0 comments on commit a9b2d6a

Please sign in to comment.