Passed
Push — master ( 07e51b...f22d02 )
by Simon
06:33
created

FluetDocumentExtensionTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testOnBeforeAddDoc() 0 10 1
1
<?php
2
3
4
namespace Firesphere\SolrFluent\Tests;
5
6
7
use Firesphere\SolrFluent\Extensions\FluentDocumentExtension;
8
use SilverStripe\Dev\SapphireTest;
9
use TractorCow\Fluent\State\FluentState;
10
11
class FluetDocumentExtensionTest extends SapphireTest
12
{
13
14
    public function testOnBeforeAddDoc()
15
    {
16
        $state = FluentState::singleton()->setLocale('en_US');
0 ignored issues
show
Unused Code introduced by
The assignment to $state is dead and can be removed.
Loading history...
17
18
        $extension = new FluentDocumentExtension();
19
        $field = ['Name' => 'Test'];
20
        $value = 'Test';
21
        $extension->onBeforeAddDoc($field, $value);
22
23
        $this->assertEquals('Test_en_US', $field['Name']);
24
    }
25
}
26