Skip to content

Commit

Permalink
Add automatic shorthand for tests that need render data
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Sep 8, 2024
1 parent a3cae27 commit 232a70e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/testing/src/UnitTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ abstract class UnitTestCase extends BaseTestCase

protected static bool $needsKernel = false;
protected static bool $needsConfig = false;
protected static bool $needsRender = false;

protected static function needsKernel(): void
{
Expand All @@ -34,6 +35,10 @@ public static function setUpBeforeClass(): void
if (static::$needsConfig) {
self::mockConfig();
}

if (static::$needsRender) {
Render::swap(new RenderData());
}
}

protected static function setupKernel(): void
Expand Down

0 comments on commit 232a70e

Please sign in to comment.