Test_ActionsPage::testAction()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace LeKoala\CmsActions\Test;
4
5
use SilverStripe\Dev\TestOnly;
6
use LeKoala\CmsActions\CustomAction;
7
use SilverStripe\CMS\Model\SiteTree;
0 ignored issues
show
Bug introduced by
The type SilverStripe\CMS\Model\SiteTree 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...
8
use SilverStripe\ORM\DataObject;
9
10
if (!class_exists(SiteTree::class)) {
11
    return;
12
}
13
14
class Test_ActionsPage extends DataObject implements TestOnly
15
{
16
    private static $table_name = 'ActionsPage';
0 ignored issues
show
introduced by
The private property $table_name is not used, and could be removed.
Loading history...
17
18
    public function getCMSActions()
19
    {
20
        $actions = parent::getCMSActions();
21
        $actions->push(new CustomAction('testAction', 'Test Action'));
22
        return $actions;
23
    }
24
25
    public function testAction()
26
    {
27
        return 'called testAction';
28
    }
29
}
30