mirror of
https://github.com/silverstripe/silverstripe-fulltextsearch
synced 2024-10-22 14:05:29 +02:00
38 lines
938 B
PHP
38 lines
938 B
PHP
|
<?php
|
||
|
|
||
|
namespace SilverStripe\FullTextSearch\Tests\State;
|
||
|
|
||
|
use SilverStripe\Core\Config\Config;
|
||
|
use SilverStripe\Dev\SapphireTest;
|
||
|
use SilverStripe\Dev\State\TestState;
|
||
|
use SilverStripe\FullTextSearch\Search\Updaters\SearchUpdater;
|
||
|
use SilverStripe\FullTextSearch\Search\Variants\SearchVariant;
|
||
|
use Symbiote\QueuedJobs\Services\QueuedJobService;
|
||
|
|
||
|
class FullTextSearchState implements TestState
|
||
|
{
|
||
|
public function setUp(SapphireTest $test)
|
||
|
{
|
||
|
// noop
|
||
|
}
|
||
|
|
||
|
public function tearDown(SapphireTest $test)
|
||
|
{
|
||
|
SearchVariant::clear_variant_cache();
|
||
|
}
|
||
|
|
||
|
public function setUpOnce($class)
|
||
|
{
|
||
|
Config::modify()->set(SearchUpdater::class, 'flush_on_shutdown', false);
|
||
|
|
||
|
if (class_exists(QueuedJobService::class)) {
|
||
|
Config::modify()->set(QueuedJobService::class, 'use_shutdown_function', false);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public function tearDownOnce($class)
|
||
|
{
|
||
|
// noop
|
||
|
}
|
||
|
}
|