SchemaFactoryExtensionTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testOnBeforeFilterFields() 0 17 1
1
<?php
2
3
4
namespace Firesphere\SolrPermissions\Tests;
5
6
use Firesphere\SolrPermissions\Extensions\SchemaFactoryExtension;
7
use SilverStripe\Dev\SapphireTest;
8
use SilverStripe\ORM\ArrayList;
9
10
class SchemaFactoryExtensionTest extends SapphireTest
11
{
12
    public function testOnBeforeFilterFields()
13
    {
14
        $list = ArrayList::create();
15
16
        $extension = new SchemaFactoryExtension();
17
18
        $extension->onBeforeFilterFields($list);
19
20
        $item = $list->first();
21
        $expected = [
22
            'Field' => 'MemberView',
23
            'Type' => 'string',
24
            'Indexed' => 'true',
25
            'Stored' => 'true',
26
            'MultiValued' => 'true',
27
        ];
28
        $this->assertEquals($expected, $item);
29
    }
30
}
31