Passed
Push — master ( 4824f8...5c9c2d )
by Simon
09:06 queued 52s
created

DocumentFactoryExtensionTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 8
c 1
b 0
f 0
dl 0
loc 17
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testUpdateDefaultFields() 0 14 1
1
<?php
2
3
4
namespace Firesphere\SolrPermissions\Tests;
5
6
7
use Firesphere\SolrPermissions\Extensions\DocumentFactoryExtension;
8
use SilverStripe\Dev\SapphireTest;
9
use Solarium\QueryType\Select\Result\Document;
10
use Solarium\QueryType\Update\Query\Query;
11
12
class DocumentFactoryExtensionTest extends SapphireTest
13
{
14
15
    public function testUpdateDefaultFields()
16
    {
17
        $update = new Query();
18
19
        $document = $update->createDocument([]);
20
21
        $extension = new DocumentFactoryExtension();
22
        $page = new \Page();
0 ignored issues
show
Bug introduced by
The type Page 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...
23
24
        $extension->updateDefaultFields($document, $page);
25
26
        $fields = $document->getFields();
27
28
        $this->assertContains('MemberView', $fields);
29
    }
30
}
31