Skip to content

Commit

Permalink
Merge branch '4.x' of https://github.com/craftcms/cms into 5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Nov 21, 2024
2 parents d303c47 + fe74e18 commit 21f8b98
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tests/fixtures/SitesFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

use Craft;
use craft\records\Site;
use craft\services\Sites;
use craft\test\ActiveFixture;

/**
Expand Down Expand Up @@ -37,9 +36,15 @@ class SitesFixture extends ActiveFixture
public function load(): void
{
parent::load();
Craft::$app->getSites()->refreshSites();
}

// Because the Sites() class memoizes on initialization we need to set() a new sites class
// with the updated fixture data
Craft::$app->set('sites', new Sites());
/**
* @inheritdoc
*/
public function unload(): void
{
parent::unload();
Craft::$app->getSites()->refreshSites();
}
}

0 comments on commit 21f8b98

Please sign in to comment.