ApiControllerTest   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testFrameworkVersionSentInHeadersIsCollected() 0 11 1
1
<?php
2
3
/**
4
 * @mixin PHPUnit_Framework_TestCase
5
 */
6
class ApiControllerTest extends FunctionalTest
7
{
8
    protected $usesDatabase = true;
9
10
    public function testFrameworkVersionSentInHeadersIsCollected()
11
    {
12
        $this->get('api/supported-addons', null, [
13
            'Silverstripe-Framework-Version' => '1.2.3',
14
        ]);
15
16
        $metrics = ApiCallerVersions::get();
17
18
        $this->assertCount(1, $metrics);
0 ignored issues
show
Bug introduced by
The method assertCount() does not seem to exist on object<ApiControllerTest>.

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...
19
        $this->assertSame('1.2.3', $metrics->first()->Version);
0 ignored issues
show
Bug introduced by
The method assertSame() does not seem to exist on object<ApiControllerTest>.

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...
20
    }
21
}
22