TestPageController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 1
eloc 3
c 2
b 0
f 1
dl 0
loc 9
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getViewer() 0 4 1
1
<?php
2
3
namespace SilverStripe\Widgets\Tests\WidgetControllerTest;
4
5
use PageController;
0 ignored issues
show
Bug introduced by
The type PageController was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use ReflectionClass;
7
use SilverStripe\Dev\TestOnly;
8
use SilverStripe\View\SSViewer;
9
use SilverStripe\Widgets\Tests\WidgetControllerTest\TestPage;
10
11
/**
12
 * @package cms
13
 * @subpackage tests
14
 */
15
class TestPageController extends PageController implements TestOnly
16
{
17
    /**
18
     * Template selection doesnt work in test folders, so we add a test theme a template name.
19
     */
20
    public function getViewer($action)
21
    {
22
        SSViewer::add_themes(['silverstripe/widgets:/tests/WidgetControllerTest']);
23
        return new SSViewer(TestPage::class);
24
    }
25
}
26