testFrameworkVersionSentInHeadersIsCollected()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.9
c 0
b 0
f 0
cc 1
nc 1
nop 0
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