Passed
Push — master ( 76df74...7115c3 )
by Gordon
02:05
created

SearchHelperTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testTextPayload() 0 12 1
1
<?php declare(strict_types = 1);
2
3
namespace Suilven\FreeTextSearch\Tests\Helper;
4
5
use SilverStripe\CMS\Model\SiteTree;
6
use SilverStripe\Dev\SapphireTest;
7
use Suilven\FreeTextSearch\Helper\SearchHelper;
8
9
class SearchHelperTest extends SapphireTest
10
{
11
    protected static $fixture_file = ['tests/fixtures/sitetree.yml'];
12
13
    public function testTextPayload(): void
14
    {
15
        $page = SiteTree::get()->first();
16
        \error_log($page->Title);
17
18
        $helper = new SearchHelper();
19
        $payload = $helper->getTextFieldPayload($page);
20
        $this->assertEquals(['sitetree' => [
21
            'Title' => 'The Break In San Marino Is Bright',
22
             'Content' => 'The wind in Kenya is waste.',
23
             'MenuTitle' => 'The Break In San Marino Is Bright',
24
        ]], $payload);
25
    }
26
}
27