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.

InputTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A can_instantiate_an_input() 0 6 1
A can_create_input_from_url() 0 7 1
A can_format_input_for_querying_api() 0 15 1
1
<?php
2
3
namespace Fab\Clarifai\Tests;
4
5
use Fab\Clarifai\Input;
6
7
class InputTest extends TestCase
8
{
9
    /** @test */
10
    function can_instantiate_an_input()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
11
    {
12
        $input = new Input();
13
14
        $this->assertInstanceOf(Input::class, $input);
15
    }
16
17
    /** @test */
18
    function can_create_input_from_url()
19
    {
20
        $input = Input::fromUrl('valid-url');
21
22
        $this->assertInstanceOf(Input::class, $input);
23
        $this->assertEquals('valid-url', $input->getUrl());
24
    }
25
26
    /** @test */
27
    function can_format_input_for_querying_api()
28
    {
29
        $format = [
30
            'data' => [
31
                'image' => [
32
                    'url' => 'valid-url',
33
                ]
34
            ]
35
        ];
36
37
        $input = Input::fromUrl('valid-url');
38
39
        $this->assertEquals($format, $input->format());
40
        $this->assertTrue(is_array($input->format()));
41
    }
42
}
43