Passed
Push — master ( a50722...2f0aca )
by Simon
07:15
created

testOnAfterFieldDefinition()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 17
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 8
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 17
rs 10
1
<?php
2
3
4
namespace Firesphere\SolrFluent\Tests;
5
6
7
use Firesphere\SolrFluent\Extensions\FluentSchemaExtension;
8
use SilverStripe\Dev\SapphireTest;
9
use SilverStripe\ORM\ArrayList;
10
use TractorCow\Fluent\Model\Locale;
11
12
class FluentSchemaExtensionTest extends SapphireTest
13
{
14
    private static $fixture_file = '../FluentTest.yml';
0 ignored issues
show
introduced by
The private property $fixture_file is not used, and could be removed.
Loading history...
15
16
    public function testOnAfterFieldDefinition()
17
    {
18
        $data = ArrayList::create();
19
20
        $item = [
21
            'Field' => 'Test'
22
        ];
23
24
        $extension = new FluentSchemaExtension();
25
26
        $extension->onAfterFieldDefinition($data, $item);
27
28
        $copy = $data->first();
29
30
        $this->assertEquals('en_NZ_Test', $copy['Field']);
31
32
        $this->assertEquals(Locale::get()->count(), $data->count());
33
    }
34
}
35