Passed
Pull Request — master (#69)
by
unknown
04:38
created

PresentedOptionsFieldTest::testConstruct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace SilverStripe\CKANRegistry\Tests\Forms;
4
5
use SilverStripe\CKANRegistry\Forms\PresentedOptionsField;
6
use SilverStripe\Dev\SapphireTest;
7
8
class PresentedOptionsFieldTest extends SapphireTest
9
{
10
    public function testConstruct()
11
    {
12
        $field = new PresentedOptionsField('my-field');
0 ignored issues
show
Bug introduced by
The call to SilverStripe\CKANRegistr...onsField::__construct() has too few arguments starting with resource. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

12
        $field = /** @scrutinizer ignore-call */ new PresentedOptionsField('my-field');

This check compares calls to functions or methods with their respective definitions. If the call has less arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
13
        $this->assertTrue(
14
            $field->hasClass('ckan-presented-options__container'),
15
            'Necessary class name for React binding is missing'
16
        );
17
    }
18
}
19