1 | <?php |
||
2 | |||
3 | |||
4 | namespace Firesphere\SolrFluent\Tests; |
||
5 | |||
6 | use Firesphere\SolrFluent\Extensions\FluentIndexExtension; |
||
7 | use Firesphere\SolrSearch\Queries\BaseQuery; |
||
8 | use Firesphere\SolrSearch\States\SiteState; |
||
9 | use SilverStripe\Dev\SapphireTest; |
||
10 | use Solarium\QueryType\Select\Query\Query; |
||
11 | use TractorCow\Fluent\Model\Locale; |
||
12 | use TractorCow\Fluent\State\FluentState; |
||
13 | |||
14 | class FluentIndexExtensionTest extends SapphireTest |
||
15 | { |
||
16 | protected static $fixture_file = '../fixtures/FluentTest.yml'; |
||
17 | |||
18 | public function testOnBeforeInit() |
||
19 | { |
||
20 | $extension = new FluentIndexExtension(); |
||
21 | |||
22 | $extension->onBeforeInit(); |
||
23 | |||
24 | // Add 2 for default values for the extensions |
||
25 | $this->assertCount((Locale::get()->count() + 2), SiteState::getStates()); |
||
26 | } |
||
27 | |||
28 | public function testOnBeforeSearch() |
||
29 | { |
||
30 | FluentState::singleton()->setLocale('en_NZ'); |
||
31 | $query = new BaseQuery(); |
||
32 | $clientQuery = new Query(); |
||
33 | $index = new \CircleCITestIndex(); |
||
0 ignored issues
–
show
|
|||
34 | |||
35 | $extension = new FluentIndexExtension(); |
||
36 | |||
37 | $extension->setOwner($index); |
||
38 | |||
39 | $extension->onBeforeSearch($query, $clientQuery); |
||
40 | |||
41 | $field = $clientQuery->getQueryDefaultField(); |
||
42 | |||
43 | $this->assertEquals('en_NZ_text', $field); |
||
44 | } |
||
45 | } |
||
46 |
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths