Source of file FluentTestState.php
Size: 1,209 Bytes - Last Modified: 2021-12-23T10:53:31+00:00
/var/www/docs.ssmods.com/process/src/src/Dev/FluentTestState.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 | <?php namespace TractorCow\Fluent\Dev; use SilverStripe\Dev\SapphireTest; use SilverStripe\Dev\State\TestState; use TractorCow\Fluent\Model\Domain; use TractorCow\Fluent\Model\Locale; class FluentTestState implements TestState { /** * Called on setup * * @param SapphireTest $test */ public function setUp(SapphireTest $test) { // Clear locale static caching between tests. $this->flushCaches(); } /** * Called on tear down * * @param SapphireTest $test */ public function tearDown(SapphireTest $test) { $this->flushCaches(); } /** * Called once on setup * * @param string $class Class being setup */ public function setUpOnce($class) { // Clear locale static caching between tests. $this->flushCaches(); } /** * Called once on tear down * * @param string $class Class being torn down */ public function tearDownOnce($class) { $this->flushCaches(); } /** * Flush all caches */ protected function flushCaches(): void { Locale::clearCached(); Domain::clearCached(); } } |