GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 9d7a62...7e48e6 )
by Rob
03:32
created

StaticCallingTraitTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 21
dl 0
loc 41
rs 10
c 1
b 0
f 0
wmc 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 11 1
testStaticCallingMethod() 0 18 ?
A hp$0 ➔ testStaticCallingMethod() 0 18 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace RattfieldNz\SafeUrls;
6
7
use RattfieldNz\SafeUrls\Libraries\Traits\StaticCalling;
8
use RattfieldNz\SafeUrls\Tests\TestCase;
9
10
class StaticCallingTraitTest extends TestCase
11
{
12
    /**
13
     * @var SafeUrls
14
     */
15
    private $safeUrls;
16
17
    private $urlsToTest;
18
19
    protected function setUp():void
20
    {
21
        parent::setUp();
22
23
        $this->safeUrls = new SafeUrls();
24
        $this->urlsToTest = [
25
            'https://testsafebrowsing.appspot.com/s/phishing.html',
26
            'https://testsafebrowsing.appspot.com/s/malware.html',
27
            'http://testsafebrowsing.appspot.com/apiv4/ANY_PLATFORM/MALWARE/URL/',
28
            'http://testsafebrowsing.appspot.com/apiv4/ANY_PLATFORM/SOCIAL_ENGINEERING/URL/',
29
            'http://malware.testing.google.test/testing/malware/',
30
        ];
31
    }
32
33
    public function testStaticCallingMethod()
34
    {
35
        $className = SafeUrls::class;
36
        $methodName = 'check';
37
38
        $testClass = new class { use StaticCalling;
39
        };
40
41
        // Only testing with returned HTTP status, as Google Safebrowsing API not working as
42
        // documented. See tests\Libraries\Curl\CurlTest testMalwareSocialEngineeringAnyPlatformUrl().
43
        $expected = 200;
44
        $actual = json_decode(
45
            $testClass->callStatic(
46
                $className, $methodName, $this->urlsToTest
47
            ), true
48
        )["status"];
49
50
        $this->assertEquals($expected, $actual);
51
    }
52
}
53