DMSDocumentAddExistingFieldTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 4
dl 0
loc 20
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testFieldContainsTreeDropdownField() 0 6 1
A testSetAndGetRecord() 0 7 1
1
<?php
2
3
class DMSDocumentAddExistingFieldTest extends SapphireTest
4
{
5
    /**
6
     * The constructor should create a tree dropdown field
7
     */
8
    public function testFieldContainsTreeDropdownField()
9
    {
10
        $field = new DMSDocumentAddExistingField('Test', 'Test');
11
        $this->assertContainsOnlyInstancesOf('TreeDropdownField', $field->getChildren());
0 ignored issues
show
Bug introduced by
The method assertContainsOnlyInstancesOf() does not exist on DMSDocumentAddExistingFieldTest. Did you maybe mean assertContains()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
12
        $this->assertSame('PageSelector', $field->getChildren()->first()->getName());
0 ignored issues
show
Bug introduced by
The method assertSame() does not seem to exist on object<DMSDocumentAddExistingFieldTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
13
    }
14
15
    public function testSetAndGetRecord()
16
    {
17
        $record = new DMSDocumentSet;
18
        $field = new DMSDocumentAddExistingField('Test');
19
        $field->setRecord($record);
20
        $this->assertSame($record, $field->getRecord());
0 ignored issues
show
Bug introduced by
The method assertSame() does not seem to exist on object<DMSDocumentAddExistingFieldTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
21
    }
22
}
23