Passed
Pull Request — master (#4)
by Gordon
08:08
created

SearchPageControllerTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 14
c 1
b 0
f 0
dl 0
loc 39
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testSearch() 0 8 1
A testEmptySearchShowResults() 0 3 1
A testEmptySearchNoResults() 0 3 1
A setUp() 0 4 1
1
<?php declare(strict_types = 1);
2
3
namespace Suilven\FreeTextSearch\Tests\Page;
4
5
use SilverStripe\Dev\FunctionalTest;
6
use Suilven\FreeTextSearch\Page\SearchPage;
7
use Suilven\FreeTextSearch\Tests\Models\FlickrPhoto;
8
9
class SearchPageControllerTest extends FunctionalTest
10
{
11
    protected static $fixture_file = [
12
        'tests/fixtures/pages.yml',
13
        'tests/fixtures/sitetree.yml',
14
        'tests/fixtures/flickrphotos.yml'
15
    ];
16
17
    protected static $extra_dataobjects = [
18
        FlickrPhoto::class,
19
    ];
20
21
    public function setUp(): void
22
    {
23
        // TODO: Change the autogenerated stub
24
        parent::setUp();
25
    }
26
27
28
    public function testEmptySearchNoResults(): void
29
    {
30
        $this->markTestSkipped('@todo');
31
    }
32
33
34
    public function testEmptySearchShowResults(): void
35
    {
36
        $this->markTestSkipped('@todo');
37
    }
38
39
40
    public function testSearch(): void
41
    {
42
        /** @var \Suilven\FreeTextSearch\Page\SearchPage $photoSearchPage */
43
        $photoSearchPage = $this->objFromFixture(SearchPage::class, 'photo-search');
44
        $photoSearchPage->publishRecursive();
45
46
        $page = $this->get('/photo-search/?q=Fish');
47
        \error_log(\print_r($$page, 1));
48
    }
49
}
50