FullTextSearchTestState   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 2 1
A tearDown() 0 3 1
A tearDownOnce() 0 2 1
A setUpOnce() 0 6 2
1
<?php
2
3
namespace SilverStripe\FullTextSearch\State;
4
5
use SilverStripe\Core\Config\Config;
6
use SilverStripe\Dev\SapphireTest;
7
use SilverStripe\Dev\State\TestState;
8
use SilverStripe\FullTextSearch\Search\Updaters\SearchUpdater;
9
use SilverStripe\FullTextSearch\Search\Variants\SearchVariant;
10
use Symbiote\QueuedJobs\Services\QueuedJobService;
0 ignored issues
show
Bug introduced by
The type Symbiote\QueuedJobs\Services\QueuedJobService was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
12
class FullTextSearchTestState implements TestState
13
{
14
    public function setUp(SapphireTest $test)
15
    {
16
        // noop
17
    }
18
19
    public function tearDown(SapphireTest $test)
20
    {
21
        SearchVariant::clear_variant_cache();
22
    }
23
24
    public function setUpOnce($class)
25
    {
26
        Config::modify()->set(SearchUpdater::class, 'flush_on_shutdown', false);
27
28
        if (class_exists(QueuedJobService::class)) {
29
            Config::modify()->set(QueuedJobService::class, 'use_shutdown_function', false);
30
        }
31
    }
32
33
    public function tearDownOnce($class)
34
    {
35
        // noop
36
    }
37
}
38