FluentDocumentExtensionTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testOnBeforeAddDoc() 0 10 1
1
<?php
2
3
4
namespace Firesphere\SolrFluent\Tests;
5
6
use Firesphere\SolrFluent\Extensions\FluentDocumentExtension;
7
use SilverStripe\Dev\SapphireTest;
8
use TractorCow\Fluent\State\FluentState;
9
10
class FluentDocumentExtensionTest extends SapphireTest
11
{
12
    public function testOnBeforeAddDoc()
13
    {
14
        FluentState::singleton()->setLocale('en_US');
15
16
        $extension = new FluentDocumentExtension();
17
        $field = ['name' => 'Test'];
18
        $value = 'Test';
19
        $extension->onBeforeAddDoc($field, $value);
20
21
        $this->assertEquals('Test_en_US', $field['name']);
22
    }
23
}
24